There are many promotions in the supermarket today. Pigeons and his friends decided to go shopping. Each of them has a shopping cart. If they want to buy something, they will put it in the shopping cart. Because they bought so many things that did not know whether they had enough money. Therefore, please help each of them to calculate the total amount of money they need to pay and tell them whether they have enough money.
输入描述:
The first line N, M, Q and X respectively represent the number of Pigeons and his friends, the number of types of goods, and there are Q kinds of goods on sale. And they have made a total of X purchases. (1<=N,M<=10, 1<=Q<=M, 1<=X <= 20)
The second line contain N different strings string[1],string[2],...,string[N]—the names of N people. (|string|<=10)
The third line contains N integers money[1],money[2],...,money[N]—the money of each person brings. (0<=money[i]<=10000)
The fourth line contains M integers cost[1],cost[2],...cost[M]—the unit price for each category of goods. (10<=cost[i]<=100 && cost[i]%10==0)
The next Q lines contain descriptions of the promotion method for category Q goods. Each line contains 3 integers A, B and C (1<=A<=M, 1<=B<=100, 1<=C<=9), which means that category A goods will be discounted by C if they are full of B pieces. (For example, the unit price of category 1 goods is 20 yuan, and a discount of 60% is allowed for full 5 pieces. If you buy 4 pieces, you need 80 yuan; If you buy 5 pieces, you need 60 yuan. If you bought 6 pieces, you need 72 yuan)
Then next X lines give shopping information, each line has a string S and two integers P,K, indicating that S purchased K pieces of goods P. (There may be repeated purchases of the same kind of goods by the same person)
输出描述:
The output has N lines. For everyone, if he has enough money, you should output "enough" (not including quotation marks), if not, you should output "not enough" (not including quotation marks)
示例1
输入
复制
3 3 2 6
Karasu Pigeons Bunny
30 30 50
20 20 20
1 2 7
2 2 8
Karasu 1 1
Karasu 1 1
Pigeons 2 2
Bunny 1 1
Bunny 2 1
Bunny 3 1
输出
复制
enough
not enough
not enough
说明
Karasu bought 2 pieces of goods 1, which cost 20*2*0.7=28 yuan. Because he brought 30 yuan, so you output "enough".
Pigeons bought 2 pieces of goods 2, which cost 20*2*0.8=32 yuan. Because he brought 30 yuan, so you output "not enough".
Bunny bought 1 piece of goods 1, 1 piece of goods 2 and 1 piece of goods 3. 20+20+20=60, so you output "not enough".
示例2
输入
复制
3 3 2 6
Karasu Pigeons Bunny
170 110 60
10 20 30
2 3 5
3 6 5
Karasu 1 10
Karasu 2 1
Bunny 2 3
Pigeons 3 4
Karasu 2 6
Bunny 2 4
输出
复制
enough
not enough
not enough
备注:
There are at most one promotion method for each goods.