시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 512 MB 2 2 2 100.000%

문제

Ahmad is shopkeeper working in a market. When a customer pays him for his shopping, he has to pay back the changes. Ahmad always wants to pay with the highest bills (if possible). Write a program to help Ahmad.

입력

First line contains T the number of test cases (0 < T < 100). Each test case has two lines. First one is the amount M (1 ≤ M ≤ 1000000) that Ahmad should pay be to customer. Second line contains m1:a1,...,mi:ai,mn:an (1 ≤ m ≤ 1000000), mi is the money bill and ai is the number of bills he has for each mi.

출력

Print the bills (sorted in descending) that Ahmad needs to pay back to the customers.

예제 입력 1

3
235
5:10,10:6,20:4,50:3
370
10:4,5:20,40:4,70:3,100:2,50:5
172
10:4,5:20,40:4,70:3,100:2,50:5

예제 출력 1

Customer1:
50 3
20 4
5 1
Customer2:
100 2
70 2
10 3
Customer3:
Impossible