n = int(eval(input()))

st = ""



while n != 0:

    r = n % 2

    if r < 0:

        r += 2

    n = int((n - r) / (-2))

    st += str(r)



st = st[::-1]



if st == "":

    st = "0"

print(st)
n = int(eval(input()))

ans = ""

while n != 0:

    r = n % (-2)

    if r < 0:

        r += 2

    n = int((n - r) / (-2))

    ans += str(r)

if ans == "":

    print((0))

else:

    print((ans[::-1]))
n = int(eval(input()))
st = ""
while n != 0:
    r = n % 2
    if r < 0:
        r += 2
    n = int((n - r) / (-2))
    st += str(r)
st = st[::-1]
if st == "":
    st = "0"
print(st)

n = int(eval(input()))
ans = ""
while n != 0:
    r = n % (-2)
    if r < 0:
        r += 2
    n = int((n - r) / (-2))
    ans += str(r)
if ans == "":
    print((0))
else:
    print((ans[::-1]))

-st = "" +ans = "" -    r = n % 2 +    r = n % (-2) -    st += str(r) -st = st[::-1] -if st == "": -    st = "0" -print(st) +    ans += str(r) +if ans == "": +    print((0)) +else: +    print((ans[::-1]))