CodeEff/ECCO huggingface dataset:
# Original solution
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(eval(input()))
def MAP(): return list(map(int, input().split()))
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

a = INT()

if a == 0:
    print((0))
    exit()

ans = ''
i = 0
while abs(a) > 0:
    # 小さいビットから見て行って、余るかどうかで値を特定していく
    if a % 2**(i+1) != 0:
        a -= (-2)**i
        ans += '1'
    else:
        ans += '0'
    i += 1
print((ans[::-1]))


# Optimized solution
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(eval(input()))
def MAP(): return list(map(int, input().split()))
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

a = INT()

if a == 0:
    print((0))
    exit()

ans = ''
while abs(a) > 0:
    # 小さいビットから見て行って、その時点の偶奇で値を特定していく
    if a % 2 == 1:
        # 今の末尾の桁は1だったので、その分を引く
        a -= 1
        ans += '1'
    else:
        ans += '0'
    # -2進数は-2で割れば桁を落とせる(10進数で割る10する感じ)
    a /= -2
print((ans[::-1]))
# Original solution
from heapq import heappush, heappop
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
#import math
#import time
#import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def StoI():
    return [ord(i)-97 for i in input()]
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
#ts=time.time()
#sys.setrecursionlimit(10**6)
#input=sys.stdin.readline
show_flg=False
show_flg=True

n=I()
ans=0
d=0

while n!=0:
    k=2**(d+1)
    if n%k!=0:
        ans+=1*10**d
        n-=(-2)**d
    d+=1
    
print(ans)


# Optimized solution
n=int(eval(input()))
t=[]
x=0
for i in range(60):
    y=((n-x)%(1<<(i+1)))*(-1)**i
    if y==(-2)**i:
        t+=['1']
        x+=(-2)**i
    else:
        t+=['0']
    if x==n:
        break
print((''.join(t)[::-1]))
# Original solution
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from functools import lru_cache, reduce
from math import ceil, floor
from sys import setrecursionlimit

import heapq
import itertools
import operator


inf = float('inf')


# globals
N = 0


def set_inputs():
    global N
    N = get_int()
    return


def main():
    setrecursionlimit(100000)
    set_inputs()
    if N == 0:
        print((0))
        return
    n = N
    ans = []
    while n != 0:
        rem = n % 2
        n = (n - rem) // (-2)
        ans.append(rem)
    ans.reverse()
    print(("".join(map(str, ans))))
    return


def get_int():
    return int(eval(input()))


def get_float():
    return float(eval(input()))


def get_str():
    return input().strip()


def get_li():
    return [int(i) for i in input().split()]


def get_lf():
    return [float(f) for f in input().split()]


def get_lc():
    return list(input().strip())


def get_data(n, types):
    if len(types) == 1:
        return [types[0](eval(input())) for _ in range(n)]
    return list(zip(*(
        [t(x) for t, x in zip(types, input().split())]
        for _ in range(n)
    )))


if __name__ == '__main__':
    main()


# Optimized solution
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from functools import lru_cache, reduce
from math import ceil, floor
from sys import setrecursionlimit

import heapq
import itertools
import operator


inf = float('inf')


# globals
N = 0


def set_inputs():
    global N
    N = get_int()
    return


def base_10_to_n(x, n):
    mod = x % n
    mod = abs(mod)
    div = (x - mod) // n
    if div == 0:
        return str(mod)
    return base_10_to_n(div, n) + str(mod)


def main():
    setrecursionlimit(100000)
    set_inputs()
    print((base_10_to_n(N, -2)))
    return


def get_int():
    return int(eval(input()))


def get_float():
    return float(eval(input()))


def get_str():
    return input().strip()


def get_li():
    return [int(i) for i in input().split()]


def get_lf():
    return [float(f) for f in input().split()]


def get_lc():
    return list(input().strip())


def get_data(n, types):
    if len(types) == 1:
        return [types[0](eval(input())) for _ in range(n)]
    return list(zip(*(
        [t(x) for t, x in zip(types, input().split())]
        for _ in range(n)
    )))


if __name__ == '__main__':
    main()
# Original solution
N=int(eval(input()))
if N == 0:
    print("0")

else:
    S = ""
    while N != 0:
        if N %2 != 0:
            S = "1" + S
            N -= 1
        else:
            S = "0" + S
        N /= -2
    print(S)


# Optimized solution
n = int(eval(input()))

s = ''
flag = True
while flag:
    if n % 2 != 0:
        s = '1' + s
        n -= 1
    else:
        s = '0' + s
    n /= -2
    if n == 0:
        flag = False
print(s)
# Original solution
n = int(eval(input()))
s = ''
i = 1
while(n != 0):
  nt = abs(n)
  res = 1 if (nt & abs(i)) else 0
  s = str(res) + s
  n -= res * i
  i *= -2
print((s if len(s) else 0))

# Optimized solution
n = int(eval(input()))
s = ''
if (n == 0):
  s = '0'
while(n != 0):
  bit = abs(n) % 2
  s = str(bit) + s
  n -= bit
  n //= -2
print(s)
# Original solution
import sys
N = int(eval(input()))
if N == -1:
  print('11')
  sys.exit()
if N == 0:
  print('0')
  sys.exit()
if N == 1:
  print('1')
  sys.exit()

def num(N):
  mi = 0
  ma = 1
  k = 1
  while mi > N or ma < N:
    mi = min(mi,mi+(-2)**k)
    ma = max(ma,ma+(-2)**k)
    k += 1
  return k-1
rem = 0
ansli = []
def ans(N):
  while abs(N)>0:
    ansli.append(num(N))
    N = N-(-2)**num(N)
  return ansli

ans(N)
answer = ''
m = max(ansli)
while m >= 0:
  if m in ansli:
    answer += '1'
  else:
    answer += '0'
  m += -1
  
print(answer)

# Optimized solution
import sys
N = int(eval(input()))
if N == 0:
  print((0))
  sys.exit()
ans = ''
k = 1
while N != 0:
  if N%(2**k) == 0:
    ans = '0'+ans
  else:
    ans = '1'+ans
    N = N-((-2)**(k-1))
  k += 1
print(ans)
# Original solution
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    L = 100000

    N = NI()

    s = 1 if N > 0 else -1
    n = abs(N)

    bit = [0] * L

    i = 0
    while n > 0:
        if n % 2:
            bit[i] += 1
            if s > 0 and i % 2 == 1 or s < 0 and i % 2 == 0:
                bit[i+1] += 1
        n //= 2
        i += 1

    for i in range(L-2):
        if bit[i] > 1:
            bit[i+2] += bit[i] // 2
            bit[i+1] += bit[i] // 2
            bit[i] = bit[i] % 2

    f = False
    ans = ''
    for i in range(L-1,-1,-1):
        if bit[i] == 1:
            ans = ''.join((ans,'1'))
            f = True
        elif f:
            ans = ''.join((ans,'0'))
    if ans == '': ans = '0'

    print(ans)





if __name__ == '__main__':
    main()

# Optimized solution
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    L = 1000

    N = NI()
    if N == 0:
        print(0)
        exit(0)

    s = 1 if N > 0 else -1
    n = abs(N)

    bit = [0] * L

    i = 0
    while n > 0:
        if n % 2:
            bit[i] += 1
            if s > 0 and i % 2 == 1 or s < 0 and i % 2 == 0:
                bit[i+1] += 1
        n //= 2
        i += 1

    for i in range(L-2):
        b = bit[i]
        if b > 1:
            b1 = bit[i+1]
            if b1 > 0:
                if b1 >= b//2:
                    bit[i+1] -= b//2
                    bit[i] = b % 2
                else:
                    bit[i+1] = 0
                    bit[i] -= b1 * 2
            if bit[i] > 1:
                bit[i+2] += bit[i] // 2
                bit[i+1] += bit[i] // 2
                bit[i] = bit[i] % 2

    bit.reverse()
    i = bit.index(1)
    print(*bit[i:],sep='')

if __name__ == '__main__':
    main()
# Original solution
N = int(eval(input()))
ans = [0] * 40
if N == 0:
    print((0))
    exit()
else:
    while N != 0:
        i = 1 if N < 0 else 0
        k = pow(-2, i)
        while abs(N) > abs(k):
            i += 2
            k += pow(-2, i)
        ans[i] = 1
        N -= pow(-2, i)

for j in range(39, -1, -1):
    if ans[j] == 1:
        print((''.join(map(str, reversed(ans[:j + 1])))))
        exit()


# Optimized solution
N = int(eval(input()))
k = 0
i = 0
ans = []
while k != N:
    j = pow(-2, i)
    p = '1' if (N - k - j) % pow(2, i + 1) == 0 else '0'
    ans.append(p)
    k += int(p) * j
    i += 1

if N == 0:
    print((0))
else:
    print((''.join(reversed(ans))))
# Original solution
N = int(eval(input()))
ans = []
if N == 0:
  ans.append("0")
while N != 0:
  ans.append(str(N % 2))
  N = -(N // 2)
ans.reverse()
print(("".join(ans)))

# Optimized solution
N = int(eval(input()))
a = []
if N == 0:
  a.append("0")
while N != 0:
  a.append(str(N % 2))
  N = -(N // 2)
print(("".join(reversed(a))))
# Original solution
#coding:utf-8


n = int(eval(input()))

ans = ''
while(n != 0):
    if n % 2 != 0:
        n -= 1
        ans = '1' + ans
    else:
        ans = '0' + ans

    n /= -2

if ans == '': ans = '0'

print(ans)

# Optimized solution
# coding:utf-8

n = int(eval(input()))

if n == 0:
    print((0))
    exit()

ans = ''
while abs(n) > 0:
    if n % 2 != 0:
        ans += '1'
        n -= 1
        n //= -2
    else:
        ans += '0'
        n //= -2

print((ans[::-1]))
# Original solution
N = int(eval(input()))

ans = ''
if N == 0:
    print((0))
    exit()

while N != 0 and N != 1:
    if N > 0:
        if N%2:
            ans += '1'
            N = -(N//2)
        else:
            ans += '0'
            N = -N//2
    else:
        if -N%2:
            ans += '1'
            N = -(N-1)//2
        else:
            ans += '0'
            N = N//(-2)
if N:
    ans += '1'
print((ans[::-1]))



# Optimized solution
N = int(eval(input()))
if N == 0:
    print((0))
    exit()
ans = ''
while N != 0:
    if N % 2:
        ans += '1'
        N -= 1
    else:
        ans += '0'
    N //= -2
print((ans[::-1]))
# Original solution
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    if n == 0:
        print((0))
    else:
        ans = []
        while n:
            if n % -2 == 0:
                ans.append("0")
                n //= -2
            else:
                ans.append("1")
                n //= -2
                n += 1
        ans.reverse()
        print(("".join(ans)))


if __name__ == '__main__':
    solve()


# Optimized solution
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n = int(input().rstrip('\n'))
    bl = []
    while True:
        if n == 0:
            break
        else:
            bl.append(str(n & 1))
            n //= 2
            n *= -1
    bl.reverse()
    print(("".join(bl) if len(bl) != 0 else 0))


if __name__ == '__main__':
    solve()
# Original solution
N = int(eval(input()))
if N == 0:
    print((0))
    exit()

ans = ''
while N != 0:
    if N%2:
        N -= 1
        ans += '1'
    else:
        ans += '0'
    N //= -2
print((ans[::-1]))

# Optimized solution
N = int(eval(input()))

if N == 0:
    print((0))
    exit()

ans = ''
while N:
    if N%2:
        N -= 1
        ans += '1'
    else:
        ans += '0'
    N //= -2

print((ans[::-1]))
# Original solution
# -*- coding: utf-8 -*-
from bisect import bisect_left
def inpl(): return list(map(int, input().split()))

N = int(eval(input()))
A = []
B = []
for i in range(2**16):
    A.append(int(("0{}"*16).format(*list(bin(i)[2:].zfill(16))), 2))
for i in range(2**16):
    B.append(-int(("{}0"*16).format(*list(bin(i)[2:].zfill(16))), 2))

for j, b in enumerate(B):
    i = bisect_left(A, N-b)
    if i == len(A):
        continue
    a = A[i]
    if a+b == N:
        ans = [""]*32
        ans[::2] = list(bin(j)[2:].zfill(16))
        ans[1::2] = list(bin(i)[2:].zfill(16))
        print((int("".join(ans))))
        break

# Optimized solution
from bisect import bisect_left
def inpl(): return list(map(int, input().split()))
N = int(eval(input()))

U = [0]*32
L = [0]*32
U[0] = 1
for i in range(1, 32):
    if i%2:
        U[i] = U[i-1]*1
        L[i] = L[i-1] + 2**i
    else:
        U[i] = U[i-1] + 2**i
        L[i] = L[i-1] * 1

searched = [0]*32
while N:
    if N < 0:
        d = bisect_left(L, -N)
        assert searched[d] != 1
        searched[d] = 1
        N += 2**d
    else:
        d = bisect_left(U, N)
        assert searched[d] != 1
        searched[d] = 1
        N -= 2**d
print(("0"*(sum(searched) == 0) + "".join(map(str, searched)).rstrip("0")[::-1]))
# Original solution
a=int(eval(input()));s=''
while a!=0:s+=str(a%2);a=-(a//2)
print((int(s[::-1]) if s != '' else 0))

# Optimized solution
a=int(eval(input()));s=''
while a!=0:s=str(a%2)+s;a=-(a//2)
print((s if s != '' else 0))
# Original solution
from collections import deque

S = deque()


def main():
    N = int(eval(input()))

    while N:
        if (abs(N % -2) == 1):
            S.appendleft('1')
            N -= 1
        else:
            S.appendleft('0')
        N //= -2

    if not S:
        S.append('0')

    print((''.join(list(S))))
    return


main()


# Optimized solution
def main():
    N = int(eval(input()))
    S = ""

    if N == 0:
        print((0))

    else:
        while N:
            if N % 2 != 0:
                S = '1' + S
                N -= 1

            else:
                S = '0' + S

            N //= -2

        print(S)

    return


main()
# Original solution
def main():
    N = int(eval(input()))
    S = ''

    if N == 0:
        print((0))

    else:
        while N:
            if N % 2 != 0:
                S = '1' + S
                N -= 1

            else:
                S = '0' + S

            N //= -2

        print(S)

    return


main()


# Optimized solution
def main():
    N = int(eval(input()))
    S = ""

    if N == 0:
        print("0")

    else:
        while N:
            if N % 2:
                N -= 1
                S = "1" + S

            else:
                S = "0" + S

            N //= -2

        print(S)

    return


main()
# Original solution
n=int(eval(input()))
def isdig(n):
  if n>=0:
    digit=0
    while n>2**digit:
      n-=2**digit
      digit+=2
  else:
    digit=1
    while n<-2**digit:
      n+=2**digit
      digit+=2
  return digit
x=["0"]*(isdig(n)+1)
while n!=0:
  digit=isdig(n)
  if digit%2==0:
    n-=2**digit
  else:
    n+=2**digit
  x[digit]="1"
x.reverse()
print(("".join(x)))

# Optimized solution
n=eval(input())
s=[]
n=int(n)
i=0
while n!=0:
  if n%2**(i+1)==0:
    s.append("0")
  else:
    s.append("1")
    n-=(-2)**i
  i+=1
s.reverse()
if s==[]:
  s=["0"]
print(("".join(s)))
# Original solution
# abc105c

N = int(eval(input()))

if N==0:
    print((0))
    exit()

a = ""
b = -2

while N!=1:
    if N%b==0:
        a += "0"
        N = N//b
    else:
        a += "1"
        if N>0:
            N = N//b + 1
        else:
            N = N//b + 1
if N==1:
    a += "1"
print((a[::-1]))

# Optimized solution
import sys

N = int(eval(input()))

if N==0:
    print((0))
    sys.exit()

ans = ""
b = -2
while N!=1:
    if N%b==0:
        ans += "0"
        N = N/b
    else:
        ans += "1"
        N = (N-1)/b
ans += "1"
print((ans[::-1]))
# Original solution
N = int(eval(input()))
ans = ""
while N != 0:
  if(N%2 == 0):
    ans += "0"
  else:
    ans += "1"
    N -= 1
  N //= -2
if(ans == ""):
  ans = "0"
print((ans[::-1]))  

# Optimized solution
N = int(eval(input()))
tmp = ''
while N:
  if(N%2 == 0):
    tmp += '0'
  else:
    tmp += '1'
  N -= 1
  N //= -2
if(tmp == ''):
  tmp = '0'
print((tmp[::-1]))
# Original solution

def main():
	n = int(eval(input()))
	ans = ""
	while n!=0:
		rem = n%(-2)
		n= n//(-2)
		if rem<0:
			rem = rem+2
			n = n+1
		ans = ans + chr(rem + ord('0'))
	if ans =="":
		print((0))
		exit()
	print((ans[::-1]))
if __name__ =="__main__":
	main()

# Optimized solution
# source wikipedia negabinary 
def main():
	n = int(eval(input()))
	ans = ""
	while n!=0:
		rem = n%(-2)
		n= n//(-2)
		if rem<0:
			rem = rem+2
			n = n+1
		ans = ans + chr(rem + ord('0'))
	if ans =="":
		print((0))
		exit()
	print((ans[::-1]))
if __name__ =="__main__":
	main()
# Original solution
#import sys
#input = sys.stdin.readline
#template input
import bisect

def IT():
    return int(eval(input()))
def IL():
    return [int(_) for _ in input().split()]
def SL():
    return [int(_) for _ in input().split()]
def ILS(n):
    return [int(eval(input())) for _ in range(n)]
def SLS(n):
    return [eval(input()) for _ in range(n)]
def ILSS(n):
    return [[int(_) for _ in input().split()] for j in range(n)]

#template technique
def bit_full_search(ss):
    n = len(ss)
    for i in range(1 << n):
        s = ""
        for j in range(n + 1):
            if ((1 & i >> j) == 1):
                s += ss[j]
        print(s)

def bit_full_search2(A):
    #https://blog.rossywhite.com/2018/08/06/bit-search/
    value = []
    for i in range(1 << len(A)):
        output = []

        for j in range(len(A)):
            if ((i >> j) & 1) == 1:
                #output.append(A[j])
                output.append(A[j])
        value.append([format(i, 'b').zfill(16), sum(output)])
    return value


"""ここからメインコード"""
def main():
    n = IT()
    #それぞれ半分全列挙
    list1 = [(-2) **  i for i in range(16)]
    list2 = [(-2) ** (i + 16) for i in range(16)]

    list1 = bit_full_search2(list1)
    list1.sort(key=lambda x:x[1])
    list1_bin = [list1[i][0] for i in range(len(list1))]
    list1_val = [list1[i][1] for i in range(len(list1))]

    list2 = bit_full_search2(list2)
    list2.sort(key=lambda x:x[1])
    list2_bin = [list2[i][0] for i in range(len(list2))]
    list2_val = [list2[i][1] for i in range(len(list2))]
    ans = 0
    for i in range(len(list1_val)):
        j = bisect.bisect_left(list2_val, n - list1_val[i])
        if j < len(list2_val):
            if list1_val[i] + list2_val[j] == n:
                ans = list2_bin[j] +list1_bin[i]
                break
    print((int(ans)))
main()



# Optimized solution
#import sys
#input = sys.stdin.readline
#template input
import bisect

def IT():
    return int(eval(input()))
def IL():
    return [int(_) for _ in input().split()]
def SL():
    return [int(_) for _ in input().split()]
def ILS(n):
    return [int(eval(input())) for _ in range(n)]
def SLS(n):
    return [eval(input()) for _ in range(n)]
def ILSS(n):
    return [[int(_) for _ in input().split()] for j in range(n)]


"""ここからメインコード"""
def main():
    n = IT()
    ans = ""
    for i in range(32):
      if n % (2 ** (i+1)) != 0:
        n -= n % (2 ** (i+1)) * (-1) ** (i % 2)
        ans += "1"
      else:
        ans += "0"
    print((int(ans[::-1])))
main()
# Original solution
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]))

# Optimized solution
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]))
# Original solution
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return eval(input())

def main():
  n=I()

  if n==0:
    return 0

  ans=''
  while n!=0:
    if n%2==0:
      ans='0'+ans
    else:
      ans='1'+ans
    n//=2
    n=-n

  return ans

# main()
print((main()))


# Optimized solution
# https://atcoder.jp/contests/arc026/tasks/arc026_2
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return eval(input())

def main():
  n=I()
  ans=''
  if n==0:
    return 0

  while True:
    if abs(n)==0:
      return ans

    if n%2==0:
      ans='0'+ans
    else:
      ans='1'+ans
    n//=2
    n*=(-1)

# main()
print((main()))
# Original solution
# C - Base -2 Number
n = int(eval(input()))
s = ""
while n!=0:
    s = str(n%2)+s
    n = -(n//2)
print((0 if s=="" else s))

# Optimized solution
n=int(eval(input()))
s=''
while n!=0:
    s=str(n%2)+s
    n=-(n//2)
if s!='':
    print(s)
else:
    print((0))
# Original solution
n = int(eval(input()))
ans = []

if n == 0:
    print('0')

else:
    while n != 0:
        if n % -2 == -1:
            n = n // -2 + 1
            ans.append('1')
        else:
            n = n // -2
            ans.append('0')
    
    ans.reverse()

    print((''.join(ans)))

# Optimized solution
n = int(eval(input()))
binary = []

if n == 0:
    print((0))
    exit()

while n != 0:
    if n % -2 != 0:
        binary.append('1')
        n //= -2
        n += 1
    else:
        binary.append('0')
        n //= -2
        
binary.reverse()

print((''.join(binary)))