Little Mirko wasn't paying attention in math class, so the teacher has decided to give him a tedious assignment to solve during the weekend.
The teacher has given him a text consisting of
The numbers can be uniquely determined by scanning through the text and always taking the largest possible number, i.e. delimited only by letters or line beginnings/ends. For example, the solution of 01a2b3456cde478
is
Since Mirko is as slow as the snail from the previous task, he has asked you to write him a program to quickly solve his assignment, so that he can go play with Slavko as soon as possible.
Input Specification
The first line of input contains the integer
The next
Each line of the text is at most
Output Specification
The output must contain
Note: The test data will ensure that
Sample Input 1
2
lo3za4
01
Sample Output 1
1
3
4
Sample Input 2
4
43silos0
zita002
le2sim
231233
Sample Output 2
0
2
2
43
231233
Sample Input 3
4
01bond
02james007
03bond
04austinpowers000
Sample Output 3
0
1
2
3
4
7
Comments