题目描述
Problem Description
Little Mirko is not paying attention in math class, so his teacher has decided to give him a tedious weekend assignment.
The teacher has provided him with a text consisting of $n$ lines, containing only digits and lowercase letters. Mirko must find all the numbers in the text and output them in non-decreasing order. He must also omit any leading zeros that the numbers might have.
These numbers can be determined by scanning the text and always using the largest possible number, delimited only by letters or the beginning/end of the line. For example, the final output for 01a2b3456cde478 is 1, 2, 478, 3456.
Since Mirko solves problems as slowly as a snail, he has asked you to write a program for him to solve the task quickly so he can play with Slavko as soon as possible.
Input Format
The first line contains an integer $n$, representing the number of lines in the text.
The next $n$ lines each contain a string.
Output Format
Each line should contain an integer, representing a number found in the text, sorted from smallest to largest.
Sample Input and Output
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
Notes
Data Size and Constraints
For $100\%$ of the data, it is guaranteed that $1 \leq n \leq 100$, each string's length does not exceed $100$, and the number of numbers in the text does not exceed $500$. The input contains only lowercase letters and digits.
Additional Notes
- This problem is worth $60$ points.
- The problem is translated from COCI2010-2011 CONTEST #2 NAPOR, translated by @mnesia.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分