N = int(eval(input()))

digits = []

i = 1

while N != 0:

    if N % pow(2,i) == 0:

        digits.append('0')

    else:

        digits.append('1')

        N -= pow(-2,i-1)

    i += 1



if digits:

    print(("".join(reversed(digits))))

else:

    print("0")

N = int(input())



ans = []

N = -N

while N != 0:

    ans.append(N%2)

    N //= -2



if ans:

    ans.reverse()

    print(*ans, sep="")

else:

    print(0)

N = int(eval(input()))
digits = []
i = 1
while N != 0:
    if N % pow(2, i) == 0:
        digits.append("0")
    else:
        digits.append("1")
        N -= pow(-2, i - 1)
    i += 1
if digits:
    print(("".join(reversed(digits))))
else:
    print("0")

N = int(input())
ans = []
N = -N
while N != 0:
    ans.append(N % 2)
    N //= -2
if ans:
    ans.reverse()
    print(*ans, sep="")
else:
    print(0)

-N = int(eval(input())) -digits = [] -i = 1 +N = int(input()) +ans = [] +N = -N -    if N % pow(2, i) == 0: -        digits.append("0") -    else: -        digits.append("1") -        N -= pow(-2, i - 1) -    i += 1 -if digits: -    print(("".join(reversed(digits)))) +    ans.append(N % 2) +    N //= -2 +if ans: +    ans.reverse() +    print(*ans, sep="") -    print("0") +    print(0)