N = int(eval(input()))



if N == 0:

    print((0))

    exit()

elif N == 1:

    print((1))

    exit()

DP = [(0,1)]

num = 0

start = 0

end = 1

while True:

    num += 1

    a = end - start + 1

    if num % 2 == 0:

        start_ = end + 1

        end_ = start_ + a - 1

        end = end_

    else:

        end_ = start - 1

        start_ = end_ - a + 1

        start = start_

    DP.append((start_, end_))

    if start <= N <= end:

        break



Ans = ''

DP[0] = (1, 1)

for i, (start, end) in enumerate(DP[::-1]):

    if start <= N <= end:

        Ans += '1'

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

    else:

        Ans += '0'



print(Ans)

N = int(eval(input()))

start = 0

end = 1

Judge = [(1, 1)]

for i in range(1, abs(N)):

    start_ = start + (-2) ** i

    end_ = end + (-2) ** i

    Judge.append((start_, end_))

    start = min(start, start_)

    end = max(end, end_)

    if start <= N <= end:

        break



n = len(Judge)

A = ['0'] * n



for i in range(n)[::-1]:

    start, end = Judge[i]

    if start <= N <= end:

        A[i] = '1'

        N -= (-2) ** i

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

N = int(eval(input()))
if N == 0:
    print((0))
    exit()
elif N == 1:
    print((1))
    exit()
DP = [(0, 1)]
num = 0
start = 0
end = 1
while True:
    num += 1
    a = end - start + 1
    if num % 2 == 0:
        start_ = end + 1
        end_ = start_ + a - 1
        end = end_
    else:
        end_ = start - 1
        start_ = end_ - a + 1
        start = start_
    DP.append((start_, end_))
    if start <= N <= end:
        break
Ans = ""
DP[0] = (1, 1)
for i, (start, end) in enumerate(DP[::-1]):
    if start <= N <= end:
        Ans += "1"
        N -= (-2) ** (num - i)
    else:
        Ans += "0"
print(Ans)

N = int(eval(input()))
start = 0
end = 1
Judge = [(1, 1)]
for i in range(1, abs(N)):
    start_ = start + (-2) ** i
    end_ = end + (-2) ** i
    Judge.append((start_, end_))
    start = min(start, start_)
    end = max(end, end_)
    if start <= N <= end:
        break
n = len(Judge)
A = ["0"] * n
for i in range(n)[::-1]:
    start, end = Judge[i]
    if start <= N <= end:
        A[i] = "1"
        N -= (-2) ** i
print(("".join(A[::-1])))

-if N == 0: -    print((0)) -    exit() -elif N == 1: -    print((1)) -    exit() -DP = [(0, 1)] -num = 0 -while True: -    num += 1 -    a = end - start + 1 -    if num % 2 == 0: -        start_ = end + 1 -        end_ = start_ + a - 1 -        end = end_ -    else: -        end_ = start - 1 -        start_ = end_ - a + 1 -        start = start_ -    DP.append((start_, end_)) +Judge = [(1, 1)] +for i in range(1, abs(N)): +    start_ = start + (-2) ** i +    end_ = end + (-2) ** i +    Judge.append((start_, end_)) +    start = min(start, start_) +    end = max(end, end_) -Ans = "" -DP[0] = (1, 1) -for i, (start, end) in enumerate(DP[::-1]): +n = len(Judge) +A = ["0"] * n +for i in range(n)[::-1]: +    start, end = Judge[i] -        Ans += "1" -        N -= (-2) ** (num - i) -    else: -        Ans += "0" -print(Ans) +        A[i] = "1" +        N -= (-2) ** i +print(("".join(A[::-1])))