import bisect

n = int(eval(input()))

ps = [0] * (1 << 16)

for i in range(1 << 16):

    temp = 0

    x = 1    

    for j in range(16):

        if (i >> j) & 1:

#                temp += (-2) ** (2 *j)

            temp += x

        x *= 4

    ps[i] = temp



pattern1 = None

pattern2 = None



for i in range(1 << 16):

    temp2 = 0

    x = 2

    for j in range(16):

        if (i >> j) & 1:

#                temp2 += (-2) ** (2 *j + 1)

            temp2 += x

        x *= 4

    n2 = n + temp2

    pattern1 = bisect.bisect_left(ps, n2)

    if pattern1 != (1 << 16) and ps[pattern1] == n2:

        pattern2 = bin(i)[2:].zfill(16)

        pattern1 = bin(pattern1)[2:].zfill(16)

        break



ans = ""

for i in range(16):

    ans += pattern2[i]

    ans += pattern1[i]

    

true_ans = ""

flag = False

for i in range(len(ans)):

    if ans[i]=="1":

        true_ans += "1"

        flag = True

    elif flag:

        true_ans += "0"



if true_ans == "":

    true_ans = "0"

        

print(true_ans)
n = int(eval(input()))

n2 = n

ans = ""

for i in range(100):

    while n != 0:

        r = (n % 2)

        n = (n - r) // (-2)

        ans = str(r) + ans

if n2==0:

    print("0")

else:

    print(ans)
import bisect

n = int(eval(input()))
ps = [0] * (1 << 16)
for i in range(1 << 16):
    temp = 0
    x = 1
    for j in range(16):
        if (i >> j) & 1:
            #                temp += (-2) ** (2 *j)
            temp += x
        x *= 4
    ps[i] = temp
pattern1 = None
pattern2 = None
for i in range(1 << 16):
    temp2 = 0
    x = 2
    for j in range(16):
        if (i >> j) & 1:
            #                temp2 += (-2) ** (2 *j + 1)
            temp2 += x
        x *= 4
    n2 = n + temp2
    pattern1 = bisect.bisect_left(ps, n2)
    if pattern1 != (1 << 16) and ps[pattern1] == n2:
        pattern2 = bin(i)[2:].zfill(16)
        pattern1 = bin(pattern1)[2:].zfill(16)
        break
ans = ""
for i in range(16):
    ans += pattern2[i]
    ans += pattern1[i]
true_ans = ""
flag = False
for i in range(len(ans)):
    if ans[i] == "1":
        true_ans += "1"
        flag = True
    elif flag:
        true_ans += "0"
if true_ans == "":
    true_ans = "0"
print(true_ans)

n = int(eval(input()))
n2 = n
ans = ""
for i in range(100):
    while n != 0:
        r = n % 2
        n = (n - r) // (-2)
        ans = str(r) + ans
if n2 == 0:
    print("0")
else:
    print(ans)

-import bisect - -ps = [0] * (1 << 16) -for i in range(1 << 16): -    temp = 0 -    x = 1 -    for j in range(16): -        if (i >> j) & 1: -            #                temp += (-2) ** (2 *j) -            temp += x -        x *= 4 -    ps[i] = temp -pattern1 = None -pattern2 = None -for i in range(1 << 16): -    temp2 = 0 -    x = 2 -    for j in range(16): -        if (i >> j) & 1: -            #                temp2 += (-2) ** (2 *j + 1) -            temp2 += x -        x *= 4 -    n2 = n + temp2 -    pattern1 = bisect.bisect_left(ps, n2) -    if pattern1 != (1 << 16) and ps[pattern1] == n2: -        pattern2 = bin(i)[2:].zfill(16) -        pattern1 = bin(pattern1)[2:].zfill(16) -        break +n2 = n -for i in range(16): -    ans += pattern2[i] -    ans += pattern1[i] -true_ans = "" -flag = False -for i in range(len(ans)): -    if ans[i] == "1": -        true_ans += "1" -        flag = True -    elif flag: -        true_ans += "0" -if true_ans == "": -    true_ans = "0" -print(true_ans) +for i in range(100): +    while n != 0: +        r = n % 2 +        n = (n - r) // (-2) +        ans = str(r) + ans +if n2 == 0: +    print("0") +else: +    print(ans)