H(BONUS) - Selective Studying

Stu wants to get a head start on his exam preparation. He has N (1<=N<32) exams coming up, and he wants to spend his limited study time wisely. There are some courses which have always seemed easy for him (and hence require little exam preparation), and some exams which he will surely fail without a great deal of studying. Stu needs a computer program to help him decide which course to study for and when in order to pass all of his exams and maximize his exam average.

Stu's exams are E1, E2, ..., EN. He has Hi hours of study time left until exam Ei (time for sleeping, eating and other annoying distractions has already been accounted for, so you don't need to worry about it). This means that if, for instance, he has only two exams, E1 and E2, with H1=2 and H3=3, then his first exam is in two hours, after which he will have an hour to study for the second exam. In all cases, Stu's last exam will come no later than one week from now.

The numbers C1, C2, ..., CN (0<=Ci<=100 for all i) are Stu's expected exam grades (assuming no preparation at all). Finally, the last N numbers - P1, P2, ..., PN (0<=Pi<=100) - represent his studying potential. For each i, Pi is the percentage of unlearned course material for exam Ei that Stu can learn in an hour of studying. After each hour, the percentages are rounded down to the nearest tenth of a percent.

For example, if C1=30 (meaning that Stu knows 30% of what he needs to know in order to ace exam E1), and P1=10, then if Stu spends one hour studying for exam E1, his confidence will increase by 7% (10% of 100-30). After one hour of studying, he is expecting to get 37% on exam E1. If he studies for one more hour, he will only gain (100-37)*10%=6.3%. So after two hours of studying, he is 43.3% confident. The next hour, he will gain (100-43.3)*10%=5.67%, which is rounded down to 5.6%. After 3 hours of studying, his confidence has gone up from 30% to 48.9%. One more hour of studying, and he will pass the exam.

Your task is to find an optimal study strategy for Stu. The strategy will tell him which hour to spend studying for which exam. A strategy is optimal if

  1. Stu passes (gets 50% or more on) all of his exams, and
  2. Stu's exam average is as high as possible.
In case of a tie between two strategies, Stu will prefer to study more for an exam Ei than for an exam Ej if i<j.

Input

The input begins with an integer Z on a line by itself. Then Z exam schedules follow. Each exam schedule is described on 4 lines:

  1. The number N.
  2. N integers: H1, H2, ..., HN.
  3. N integers: C1, C2, ..., CN.
  4. N integers: P1, P2, ..., PN.
The numbers on lines 2-4 are separated by (any number of) spaces.

Output

For each exam schedule, print one line:

  • "Hopeless!" if Stu will fail at least one exam, no matter how he spends his study time, or
  • "AVG: X1 X2 ... XN
AVG is Stu's exam score average. Xi is his score on exam Ei, assuming he follows the optimal studying strategy. There is exactly one space before each Xi. All numbers are rounded to the nearest tenth of a percent. See sample input and output for the exact output format.

Sample input

3
3
  3  60 120
 30 100  60
 10  17   3
2
  4  10
 30  45
 10  10
4
 16  40  82  80
 80  40  90  30
 30   1   5  15

Sample output

Hopeless!
62.3%: 54.0% 70.6%
86.8%: 98.7% 54.9% 95.6% 98.1%