x=int(input())



LIST2=[1]

LIST2X=[-2]



N=1

for i in range(1,30):

    N=N+4**i

    LIST2.append(N)

N=-2

for i in range(1,30):

    N=N-2*4**i

    LIST2X.append(N)







LIST=[0]*60



def nex(N):

    if N>0:

        for i in range(30):

            if N<=LIST2[i]:

                break

        LIST[i*2]+=1

        return N-(-2)**(i*2)



    if N<0:

        for i in range(30):

            if N>=LIST2X[i]:

                break

        LIST[i*2+1]+=1

        return N-(-2)**(i*2+1)



while x!=0:

    x=nex(x)

    #print(x)



for i in range(59,-1,-1):

    if LIST[i]==1:

        break



for j in range(i,-1,-1):

    print(LIST[j],end="")

            



        

N=int(eval(input()))

if N==0:

    print((0))

s=""

while N:

    if N%2==1:

        s="1"+s

        N-=1

    else:

        s="0"+s

    N=-N//2

print(s)
x = int(input())
LIST2 = [1]
LIST2X = [-2]
N = 1
for i in range(1, 30):
    N = N + 4**i
    LIST2.append(N)
N = -2
for i in range(1, 30):
    N = N - 2 * 4**i
    LIST2X.append(N)
LIST = [0] * 60


def nex(N):
    if N > 0:
        for i in range(30):
            if N <= LIST2[i]:
                break
        LIST[i * 2] += 1
        return N - (-2) ** (i * 2)
    if N < 0:
        for i in range(30):
            if N >= LIST2X[i]:
                break
        LIST[i * 2 + 1] += 1
        return N - (-2) ** (i * 2 + 1)


while x != 0:
    x = nex(x)
    # print(x)
for i in range(59, -1, -1):
    if LIST[i] == 1:
        break
for j in range(i, -1, -1):
    print(LIST[j], end="")

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

-x = int(input()) -LIST2 = [1] -LIST2X = [-2] -N = 1 -for i in range(1, 30): -    N = N + 4**i -    LIST2.append(N) -N = -2 -for i in range(1, 30): -    N = N - 2 * 4**i -    LIST2X.append(N) -LIST = [0] * 60 - - -def nex(N): -    if N > 0: -        for i in range(30): -            if N <= LIST2[i]: -                break -        LIST[i * 2] += 1 -        return N - (-2) ** (i * 2) -    if N < 0: -        for i in range(30): -            if N >= LIST2X[i]: -                break -        LIST[i * 2 + 1] += 1 -        return N - (-2) ** (i * 2 + 1) - - -while x != 0: -    x = nex(x) -    # print(x) -for i in range(59, -1, -1): -    if LIST[i] == 1: -        break -for j in range(i, -1, -1): -    print(LIST[j], end="") +N = int(eval(input())) +if N == 0: +    print((0)) +s = "" +while N: +    if N % 2 == 1: +        s = "1" + s +        N -= 1 +    else: +        s = "0" + s +    N = -N // 2 +print(s)