N = int(eval(input()))



ans = []

num = 0

while True:

    if N % (2**(num + 1)) == 0:

        b = 0

    else:

        b = 1

    ans.append(str(b))

    N = N - ((-2)**num) * b

    num += 1

    if N == 0:

        break

print((''.join(ans[::-1])))

N = int(eval(input()))

a = ''

n = 0

while N != 0:

    b = '0' if N % (2**(n + 1)) == 0 else '1'

    a += b

    N -= ((-2)**n) * int(b)

    n += 1

print((a[::-1] if a else 0))

N = int(eval(input()))
ans = []
num = 0
while True:
    if N % (2 ** (num + 1)) == 0:
        b = 0
    else:
        b = 1
    ans.append(str(b))
    N = N - ((-2) ** num) * b
    num += 1
    if N == 0:
        break
print(("".join(ans[::-1])))

N = int(eval(input()))
a = ""
n = 0
while N != 0:
    b = "0" if N % (2 ** (n + 1)) == 0 else "1"
    a += b
    N -= ((-2) ** n) * int(b)
    n += 1
print((a[::-1] if a else 0))

-ans = [] -num = 0 -while True: -    if N % (2 ** (num + 1)) == 0: -        b = 0 -    else: -        b = 1 -    ans.append(str(b)) -    N = N - ((-2) ** num) * b -    num += 1 -    if N == 0: -        break -print(("".join(ans[::-1]))) +a = "" +n = 0 +while N != 0: +    b = "0" if N % (2 ** (n + 1)) == 0 else "1" +    a += b +    N -= ((-2) ** n) * int(b) +    n += 1 +print((a[::-1] if a else 0))