N = int(eval(input()))



ans = 0

if N != 0:

    s = ''

    while N != 0:

        if N % 2 != 0:

            N -= 1

            s = '1' + s

        else:

            s = '0' + s

        N //= -2

    ans = s



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



ans = 0

if n != 0:

    s = ''

    while n != 0:

        if n % 2 != 0:

            n -= 1

            s = '1' + s

        else:

            s = '0' + s

        n //= -2

    ans = s



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

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

-N = int(eval(input())) +n = int(eval(input())) -if N != 0: +if n != 0: -    while N != 0: -        if N % 2 != 0: -            N -= 1 +    while n != 0: +        if n % 2 != 0: +            n -= 1 -        N //= -2 +        n //= -2