N = int(eval(input()))



ans = ''

isOdd = False

while N != 0 :

    if N % 2 == 1 :

        ans += '1'

    else :

        ans += '0'

    if isOdd :

        N += 1

    N //= 2

    isOdd = not isOdd



if ans == '' :

    print('0')

else :

    print((ans[::-1]))
N = int(eval(input()))



if N == 0:

    print((0))

    exit()



ans = []

while N != 0:

    d = len(ans)

    if N % 2 == 1:

        ans.append('1')

        N -= pow(-1, d)

        N //= 2

    else:

        ans.append('0')

        N //= 2



print((''.join(ans[::-1])))

N = int(eval(input()))
ans = ""
isOdd = False
while N != 0:
    if N % 2 == 1:
        ans += "1"
    else:
        ans += "0"
    if isOdd:
        N += 1
    N //= 2
    isOdd = not isOdd
if ans == "":
    print("0")
else:
    print((ans[::-1]))

N = int(eval(input()))
if N == 0:
    print((0))
    exit()
ans = []
while N != 0:
    d = len(ans)
    if N % 2 == 1:
        ans.append("1")
        N -= pow(-1, d)
        N //= 2
    else:
        ans.append("0")
        N //= 2
print(("".join(ans[::-1])))

-ans = "" -isOdd = False +if N == 0: +    print((0)) +    exit() +ans = [] +    d = len(ans) -        ans += "1" +        ans.append("1") +        N -= pow(-1, d) +        N //= 2 -        ans += "0" -    if isOdd: -        N += 1 -    N //= 2 -    isOdd = not isOdd -if ans == "": -    print("0") -else: -    print((ans[::-1])) +        ans.append("0") +        N //= 2 +print(("".join(ans[::-1])))