var i:byte;c:char;begin repeat read(c);if c=^`then writeln else for i:=0to 3do write((ord(c)+3)shr(3-i)and 1)until 0>0end.