f=lambda x,l=len,r=range:'\n'.join(*x)if l(x)<2 else f([[x[i][j]+['0',''][j<=l(x[i])//2]for j in r(l(x[i]))]+[['?','?<'][l(x)<3]]+[x[i+1][j]+['1',''][j>=l(x[i])//2]for j in r(l(x[i]))]for i in r(0,l(x),2)]) print(f(['1','1','1','0','0','1','1','1']))
Standard input is empty
1 ? 10 ? 110 ?0 00 ?< 01 ?1 101 ? 11 ? 1
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!