n=int(eval(input()))

if n == 0:

    print((0))

k=-2

bi=''

while n!=0:

    bi+=str(n%abs(k))

    if k<0:n=-(-n//k)

    else:n=n//k

print((bi[::-1]))
n=int(eval(input()))

if n == 0:

    print((0))

s = ""



while n != 0:

    if n%2 == 0:

        

        s = "0" + s

    elif n%2 == 1:

        n -= 1

        s = "1" +s

    n = (n//-2)



print(s)
n = int(eval(input()))
if n == 0:
    print((0))
k = -2
bi = ""
while n != 0:
    bi += str(n % abs(k))
    if k < 0:
        n = -(-n // k)
    else:
        n = n // k
print((bi[::-1]))

n = int(eval(input()))
if n == 0:
    print((0))
s = ""
while n != 0:
    if n % 2 == 0:
        s = "0" + s
    elif n % 2 == 1:
        n -= 1
        s = "1" + s
    n = n // -2
print(s)

-k = -2 -bi = "" +s = "" -    bi += str(n % abs(k)) -    if k < 0: -        n = -(-n // k) -    else: -        n = n // k -print((bi[::-1])) +    if n % 2 == 0: +        s = "0" + s +    elif n % 2 == 1: +        n -= 1 +        s = "1" + s +    n = n // -2 +print(s)