q=() while 1:a=[l[len(q)]for l in q]+raw_input().split();print" ".join(a);q+=a,