N=int(eval(input()))

if(N==0):

    print((0))

    exit()

res=''

while(N!=0):

    r=N%2

    if(r<0):

        r+=2

    res+=str(r)

    N=(N-r)//(-2)

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

s=''

if(N==0):

    print((0))

    exit()

while(N!=0):

    m=N%2

    s+=str(m)

    N=(N-m)//-2

print((s[::-1]))
N = int(eval(input()))
if N == 0:
    print((0))
    exit()
res = ""
while N != 0:
    r = N % 2
    if r < 0:
        r += 2
    res += str(r)
    N = (N - r) // (-2)
print((res[::-1]))

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

+s = "" -res = "" -    r = N % 2 -    if r < 0: -        r += 2 -    res += str(r) -    N = (N - r) // (-2) -print((res[::-1])) +    m = N % 2 +    s += str(m) +    N = (N - m) // -2 +print((s[::-1]))