文理学院程序设计在线练习


Extract

Time Limit: 1 Second(s)    Memory Limit: 32 MB

Total Submission(s): 0   Accepted Submission(s): 0
Problem Description

Xiaoxi has a string which includes lowercase letters, uppercase letters, comma and digits.
She hope you write a program to extract all numbers from the string.
The samples will provide more information.

Input

The first line of input is the number of testcases T.
The first line of each testcase contains a integer N : the string length
Then a line the string.
T <= 10
1<= n <= 100000
It is guaranteed that each number in string is no more than 1000000000.

Output

For each testcase, output two lines.
First line an integer means the count of number in strings.
Second line all the numbers from the string, separated with blank space.

Sample Input
2
9
3,1112,05
10
1A1baba1,0
Sample Output
3
3 1112 5
4
1 1 1 0
Source

2019绍兴市计算机技能竞赛