d='' p='\x09'*99 t=[p]*89 r=range(99) try: while 1:t+=[d+raw_input()+p,p];d+=' ' except: t+=[p]*199 for x in['\x09'.join(t[i+j][j]for j in r).rstrip('\x09')for i in r]: if x>p:print x.replace('\x09',' ')
Note that non-ascii characters in the above source code will be escaped (such as \x9f).