# -*- coding: utf-8 -*-

from bisect import bisect_left

def inpl(): return list(map(int, input().split()))



N = int(eval(input()))

A = []

B = []

for i in range(2**16):

    A.append(int(("0{}"*16).format(*list(bin(i)[2:].zfill(16))), 2))

for i in range(2**16):

    B.append(-int(("{}0"*16).format(*list(bin(i)[2:].zfill(16))), 2))



for j, b in enumerate(B):

    i = bisect_left(A, N-b)

    if i == len(A):

        continue

    a = A[i]

    if a+b == N:

        ans = [""]*32

        ans[::2] = list(bin(j)[2:].zfill(16))

        ans[1::2] = list(bin(i)[2:].zfill(16))

        print((int("".join(ans))))

        break
from bisect import bisect_left

def inpl(): return list(map(int, input().split()))

N = int(eval(input()))



U = [0]*32

L = [0]*32

U[0] = 1

for i in range(1, 32):

    if i%2:

        U[i] = U[i-1]*1

        L[i] = L[i-1] + 2**i

    else:

        U[i] = U[i-1] + 2**i

        L[i] = L[i-1] * 1



searched = [0]*32

while N:

    if N < 0:

        d = bisect_left(L, -N)

        assert searched[d] != 1

        searched[d] = 1

        N += 2**d

    else:

        d = bisect_left(U, N)

        assert searched[d] != 1

        searched[d] = 1

        N -= 2**d

print(("0"*(sum(searched) == 0) + "".join(map(str, searched)).rstrip("0")[::-1]))
# -*- coding: utf-8 -*-
from bisect import bisect_left


def inpl():
    return list(map(int, input().split()))


N = int(eval(input()))
A = []
B = []
for i in range(2**16):
    A.append(int(("0{}" * 16).format(*list(bin(i)[2:].zfill(16))), 2))
for i in range(2**16):
    B.append(-int(("{}0" * 16).format(*list(bin(i)[2:].zfill(16))), 2))
for j, b in enumerate(B):
    i = bisect_left(A, N - b)
    if i == len(A):
        continue
    a = A[i]
    if a + b == N:
        ans = [""] * 32
        ans[::2] = list(bin(j)[2:].zfill(16))
        ans[1::2] = list(bin(i)[2:].zfill(16))
        print((int("".join(ans))))
        break

from bisect import bisect_left


def inpl():
    return list(map(int, input().split()))


N = int(eval(input()))
U = [0] * 32
L = [0] * 32
U[0] = 1
for i in range(1, 32):
    if i % 2:
        U[i] = U[i - 1] * 1
        L[i] = L[i - 1] + 2**i
    else:
        U[i] = U[i - 1] + 2**i
        L[i] = L[i - 1] * 1
searched = [0] * 32
while N:
    if N < 0:
        d = bisect_left(L, -N)
        assert searched[d] != 1
        searched[d] = 1
        N += 2**d
    else:
        d = bisect_left(U, N)
        assert searched[d] != 1
        searched[d] = 1
        N -= 2**d
print(("0" * (sum(searched) == 0) + "".join(map(str, searched)).rstrip("0")[::-1]))

-# -*- coding: utf-8 -*- -A = [] -B = [] -for i in range(2**16): -    A.append(int(("0{}" * 16).format(*list(bin(i)[2:].zfill(16))), 2)) -for i in range(2**16): -    B.append(-int(("{}0" * 16).format(*list(bin(i)[2:].zfill(16))), 2)) -for j, b in enumerate(B): -    i = bisect_left(A, N - b) -    if i == len(A): -        continue -    a = A[i] -    if a + b == N: -        ans = [""] * 32 -        ans[::2] = list(bin(j)[2:].zfill(16)) -        ans[1::2] = list(bin(i)[2:].zfill(16)) -        print((int("".join(ans)))) -        break +U = [0] * 32 +L = [0] * 32 +U[0] = 1 +for i in range(1, 32): +    if i % 2: +        U[i] = U[i - 1] * 1 +        L[i] = L[i - 1] + 2**i +    else: +        U[i] = U[i - 1] + 2**i +        L[i] = L[i - 1] * 1 +searched = [0] * 32 +while N: +    if N < 0: +        d = bisect_left(L, -N) +        assert searched[d] != 1 +        searched[d] = 1 +        N += 2**d +    else: +        d = bisect_left(U, N) +        assert searched[d] != 1 +        searched[d] = 1 +        N -= 2**d +print(("0" * (sum(searched) == 0) + "".join(map(str, searched)).rstrip("0")[::-1]))