测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A10722. Comments

编程题 普及/提高-

题目描述

The first line contains non-empty comments feed in the described format. It consists of uppercase and lowercase letters of English alphabet, digits and commas.

It is guaranteed that each comment is a non-empty string consisting of uppercase and lowercase English characters. Each of the number of comments is integer (consisting of at least one digit), and either equals $0$ or does not contain leading zeros.

The length of the whole string does not exceed $10^{6}$ . It is guaranteed that given structure of comments is valid.

输入格式

Print comments in a format that is given in the statement. For each level of nesting, comments should be printed in the order they are given in the input.

输出格式

The first example is explained in the statements.

输入输出样例

输入 #1
hello,2,ok,0,bye,0,test,0,one,1,two,2,a,0,b,0
输出 #1
3
hello test one 
ok bye two 
a b 
输入 #2
a,5,A,0,a,0,A,0,a,0,A,0
输出 #2
2
a 
A a A a A 
输入 #3
A,3,B,2,C,0,D,1,E,0,F,1,G,0,H,1,I,1,J,0,K,1,L,0,M,2,N,0,O,1,P,0
输出 #3
4
A K M 
B F H L N O 
C D G I P 
E J 

说明/提示

The first example is explained in the statements.
上一题 去做题 下一题