t=reverse f('1':x)='0':f x f(_:x)='1':x f x=x m@main=getLine>>=putStrLn.t.f.t>>m