After watching the movie 21, Kuo is curious about casino.
There is a casino which opens N days in this month.
There will be two kind of events in a day.
Whenever one become bankrupt, they will be kicked out of the casino and be blacklisted.
If the amout of money someone win in a play exceed (that is, >) twice of their <Skill>, they will be seen as cheaters, kicked out of the casino, and blacklisted. (The casino still has to pay the money they win to them.)
Someone blacklisted are not permitted to enter the casino.
Note: If someone have to pay X money but they only have Y money where Y <= X, they will only pay Y money and become bankrupt.
At the end of each day, everyone will leave the casino.
Please help Kuo-chan find how much income the casino gets in this month and who are blacklisted.
The first line of the input contains a number N — the number of days in this month.
The following contains N blocks.
The first line of each block is Casino Q — it means there will be Q events this day.
The next Q lines is one of the following:
N <= 1000, Q <= 100.
There will be at most 1000 different people come to the casino; that is, there are at most 1000 people with different names. Therefore, there will be at most 1000 people blacklisted.
All number is within the range of int.
You should print a number U in the first line — how much income the casino gets in this month.
If there are K people blacklisted in this month, you should output their names in K lines in the order they get blacklisted.