N = int(eval(input()))

if N == 0:

    print((0))

    exit()



ans = ''

while N != 0:

    if N%2:

        N -= 1

        ans += '1'

    else:

        ans += '0'

    N //= -2

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



if N == 0:

    print((0))

    exit()



ans = ''

while N:

    if N%2:

        N -= 1

        ans += '1'

    else:

        ans += '0'

    N //= -2



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

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

-while N != 0: +while N: