N = int(eval(input()))



def solve(N):

    if N == 0:

        return "0"

    result = ""

    n = N

    i = 0

    while n:

        k = (-2)**i

        if n & (1 << i):

            n -= k

            result = "1" + result

        else:

            result = "0" + result

        i += 1

    return result



print((solve(N)))

N = int(eval(input()))



def solve(N):

    result = ""

    k = 1

    while 1:

        c = N % 2

        result = "01"[c] + result

        N = (N - k * c) // 2

        k = -k

        if N == 0:

            break

    return result



print((solve(N)))

N = int(eval(input()))


def solve(N):
    if N == 0:
        return "0"
    result = ""
    n = N
    i = 0
    while n:
        k = (-2) ** i
        if n & (1 << i):
            n -= k
            result = "1" + result
        else:
            result = "0" + result
        i += 1
    return result


print((solve(N)))

N = int(eval(input()))


def solve(N):
    result = ""
    k = 1
    while 1:
        c = N % 2
        result = "01"[c] + result
        N = (N - k * c) // 2
        k = -k
        if N == 0:
            break
    return result


print((solve(N)))

-    if N == 0: -        return "0" -    n = N -    i = 0 -    while n: -        k = (-2) ** i -        if n & (1 << i): -            n -= k -            result = "1" + result -        else: -            result = "0" + result -        i += 1 +    k = 1 +    while 1: +        c = N % 2 +        result = "01"[c] + result +        N = (N - k * c) // 2 +        k = -k +        if N == 0: +            break