n = int(eval(input()))

I = [[0,1]]

while n < I[-1][0] or I[-1][1] < n:

  if len(I)%2 != 0:

    I += [[I[-1][0]-2**(len(I)),I[-1][1]]]

  else:

    I += [[I[-1][0],I[-1][1]+2**(len(I))]]

ans = ''

for i in range(len(I)):

  if abs((I[-i-1][0]+I[-i-1][1])/2) < abs(n) and n * (-1)**(len(I)-i-1) > 0:

    ans += '1'

    n -= (-2)**(len(I)-i-1)

  else:

    ans += '0'

print((int(ans)))
N = int(eval(input()))



lt = [0 for _ in range(50)]

rt = [0 for _ in range(50)]



lt[0] = 1

rt[0] = 1

lt[1] = -2

rt[1] = -1



for i in range(2, 50):

    if i % 2 == 0:

        lt[i] = rt[i - 2] + 1

        rt[i] = lt[i] + 2**i - 1

    else:

        rt[i] = lt[i - 2] - 1

        lt[i] = rt[i] - 2**i + 1





res = [0 for _ in range(50)]

while N:

    for i in range(50):

        if lt[i] <= N <= rt[i]:

            res[~i] = 1

            N -= (-2)**i

            break

            

print((int(''.join(map(str, res)))))
n = int(eval(input()))
I = [[0, 1]]
while n < I[-1][0] or I[-1][1] < n:
    if len(I) % 2 != 0:
        I += [[I[-1][0] - 2 ** (len(I)), I[-1][1]]]
    else:
        I += [[I[-1][0], I[-1][1] + 2 ** (len(I))]]
ans = ""
for i in range(len(I)):
    if (
        abs((I[-i - 1][0] + I[-i - 1][1]) / 2) < abs(n)
        and n * (-1) ** (len(I) - i - 1) > 0
    ):
        ans += "1"
        n -= (-2) ** (len(I) - i - 1)
    else:
        ans += "0"
print((int(ans)))

N = int(eval(input()))
lt = [0 for _ in range(50)]
rt = [0 for _ in range(50)]
lt[0] = 1
rt[0] = 1
lt[1] = -2
rt[1] = -1
for i in range(2, 50):
    if i % 2 == 0:
        lt[i] = rt[i - 2] + 1
        rt[i] = lt[i] + 2**i - 1
    else:
        rt[i] = lt[i - 2] - 1
        lt[i] = rt[i] - 2**i + 1
res = [0 for _ in range(50)]
while N:
    for i in range(50):
        if lt[i] <= N <= rt[i]:
            res[~i] = 1
            N -= (-2) ** i
            break
print((int("".join(map(str, res)))))

-n = int(eval(input())) -I = [[0, 1]] -while n < I[-1][0] or I[-1][1] < n: -    if len(I) % 2 != 0: -        I += [[I[-1][0] - 2 ** (len(I)), I[-1][1]]] +N = int(eval(input())) +lt = [0 for _ in range(50)] +rt = [0 for _ in range(50)] +lt[0] = 1 +rt[0] = 1 +lt[1] = -2 +rt[1] = -1 +for i in range(2, 50): +    if i % 2 == 0: +        lt[i] = rt[i - 2] + 1 +        rt[i] = lt[i] + 2**i - 1 -        I += [[I[-1][0], I[-1][1] + 2 ** (len(I))]] -ans = "" -for i in range(len(I)): -    if ( -        abs((I[-i - 1][0] + I[-i - 1][1]) / 2) < abs(n) -        and n * (-1) ** (len(I) - i - 1) > 0 -    ): -        ans += "1" -        n -= (-2) ** (len(I) - i - 1) -    else: -        ans += "0" -print((int(ans))) +        rt[i] = lt[i - 2] - 1 +        lt[i] = rt[i] - 2**i + 1 +res = [0 for _ in range(50)] +while N: +    for i in range(50): +        if lt[i] <= N <= rt[i]: +            res[~i] = 1 +            N -= (-2) ** i +            break +print((int("".join(map(str, res)))))