def f(L,D=0,S='',d=0): for c in L:C=c>'(';S+=[' ',c][d-C==D];d-=C*2-1 if'('in S:print S.rstrip();f(L,D+1) f(raw_input()) f('')
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page