# abc105c



N = int(eval(input()))



if N==0:

    print((0))

    exit()



a = ""

b = -2



while N!=1:

    if N%b==0:

        a += "0"

        N = N//b

    else:

        a += "1"

        if N>0:

            N = N//b + 1

        else:

            N = N//b + 1

if N==1:

    a += "1"

print((a[::-1]))
import sys



N = int(eval(input()))



if N==0:

    print((0))

    sys.exit()



ans = ""

b = -2

while N!=1:

    if N%b==0:

        ans += "0"

        N = N/b

    else:

        ans += "1"

        N = (N-1)/b

ans += "1"

print((ans[::-1]))
# abc105c
N = int(eval(input()))
if N == 0:
    print((0))
    exit()
a = ""
b = -2
while N != 1:
    if N % b == 0:
        a += "0"
        N = N // b
    else:
        a += "1"
        if N > 0:
            N = N // b + 1
        else:
            N = N // b + 1
if N == 1:
    a += "1"
print((a[::-1]))

import sys

N = int(eval(input()))
if N == 0:
    print((0))
    sys.exit()
ans = ""
b = -2
while N != 1:
    if N % b == 0:
        ans += "0"
        N = N / b
    else:
        ans += "1"
        N = (N - 1) / b
ans += "1"
print((ans[::-1]))

-# abc105c +import sys + -    exit() -a = "" +    sys.exit() +ans = "" -        a += "0" -        N = N // b +        ans += "0" +        N = N / b -        a += "1" -        if N > 0: -            N = N // b + 1 -        else: -            N = N // b + 1 -if N == 1: -    a += "1" -print((a[::-1])) +        ans += "1" +        N = (N - 1) / b +ans += "1" +print((ans[::-1]))