from numpy import cumsum

N = int(eval(input()))

lis = [0]*40

tmp = [0,2]+[2**(i*2) for i in range(1,23)]

rui = cumsum(tmp)

for i in range(40):

    if i==0:

        if N%2 == 1:

            lis[0]=1

    else:

        if (N-rui[(i+1)//2])%((2**i) *2) < 2**i:

            lis[i]=1





print((int("".join(map(str,reversed(lis))))))

N = int(eval(input()))

lis = [0]*40

tmp = [2]+[2**(i*2) for i in range(1,23)]

rui = [0]

for t in tmp:

    rui.append(rui[-1]+t)

for i in range(40):

    if i==0:

        if N%2 == 1:

            lis[0]=1

    else:

        if (N-rui[(i+1)//2])%((2**i) *2) < 2**i:

            lis[i]=1





print((int("".join(map(str,reversed(lis))))))

from numpy import cumsum

N = int(eval(input()))
lis = [0] * 40
tmp = [0, 2] + [2 ** (i * 2) for i in range(1, 23)]
rui = cumsum(tmp)
for i in range(40):
    if i == 0:
        if N % 2 == 1:
            lis[0] = 1
    else:
        if (N - rui[(i + 1) // 2]) % ((2**i) * 2) < 2**i:
            lis[i] = 1
print((int("".join(map(str, reversed(lis))))))

N = int(eval(input()))
lis = [0] * 40
tmp = [2] + [2 ** (i * 2) for i in range(1, 23)]
rui = [0]
for t in tmp:
    rui.append(rui[-1] + t)
for i in range(40):
    if i == 0:
        if N % 2 == 1:
            lis[0] = 1
    else:
        if (N - rui[(i + 1) // 2]) % ((2**i) * 2) < 2**i:
            lis[i] = 1
print((int("".join(map(str, reversed(lis))))))

-from numpy import cumsum - -tmp = [0, 2] + [2 ** (i * 2) for i in range(1, 23)] -rui = cumsum(tmp) +tmp = [2] + [2 ** (i * 2) for i in range(1, 23)] +rui = [0] +for t in tmp: +    rui.append(rui[-1] + t)