a=io.read()b=#a if b==7 then a="long";b=4 end for i=0,2^b do for j=1,b do io.write(a:sub(j,j-1+math.floor(i/2^(b-j)%2)))end print()end