CodeEff/ECCO huggingface dataset:
# Original solution
import math
import sys

n = int(eval(input()))
if n == 0:
  print((0))
  sys.exit()
  
keta = 0
under = 0
s = ""
nn = 1

if n > 0:
    while True:
      if sum([2**i for i in range(0,nn,2)])+1<= n and n <= sum([2**i for i in range(0,nn+1,2)]):
          keta = nn+1
          under = sum([2**i for i in range(0,nn,2)])
          break
      else:
          nn+=1

    for i in range(1,keta):
        remainder = (n-under)%(2**i)
        if remainder in range(1,2**(i-1)+1):
            s += "0" if i%2==1 else "1"
        else:
            s += "1" if i%2==1 else "0"
    else:
        s+="1"
    print((s[::-1]))

else:
    while True:
        if n <= sum([(-2)**i for i in range(1,nn,2)]) and n >= sum([(-2)**i for i in range(1,nn+1,2)]):
            keta = nn+1
            under = sum([(-2)**i for i in range(1,nn,2)])
            break
        else:
            nn+=1

    for i in range(1,keta):
        remainder = abs(n-under)%(2**i)
        if remainder in range(1,2**(i-1)+1):
            s += "1" if i%2==1 else "0"
        else:
            s += "0" if i%2==1 else "1"
    else:
        s+="1"
    print((s[::-1]))
    




# Optimized solution
#!/usr/bin/env python3
import sys
from math import ceil

def solve(N: int):
    if N == 0:
        print((0))
        return 

    answer = ""
    while N != 0:
        syou = ceil(N/-2) 
        amari = N-syou*-2

        answer+= str(amari)
        N = syou
    
    print((answer[::-1]))

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()
# Original solution
import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())

N = int(eval(input()))
if N == 0:
    print('0')
    exit()

ans = ''
while abs(N) > 0:
    if abs(N) % 2 == 0:
        ans += '0'
        N //= 2
    elif N < 0:
        N = (N - 1) // 2
        ans += '1'
    else:
        ans += '1'
        N //= 2
    N *= -1
print((ans[::-1]))





# Optimized solution
N = int(eval(input()))
if N == 0:
    print('0')
    exit()

ans = ''
while abs(N) > 0:
    if abs(N) % 2 == 0:
        ans += '0'
        N //= 2
    else:
        N -= 1
        N //= 2
        ans += '1'
    N *= -1
print((ans[::-1]))
# Original solution
from math import ceil, log
from itertools import product


def solve(string):
    n = int(string)
    base = [2**i for i in range(1, 40)]
    inc = [(-2)**i for i in range(40)]
    ans = ""
    for b, i in zip(base, inc):
        if n % b >= b // 2:
            n -= i
            ans += "1"
        else:
            ans += "0"
        if n == 0:
            break
    return ans[::-1]


if __name__ == '__main__':
    print((solve(eval(input()))))


# Optimized solution
def solve(string):
    n = int(string)
    base = [(-2)**i for i in range(40)]
    ans = ""
    for b in base:
        if n % abs(2 * b) >= abs(b):
            n -= b
            ans += "1"
        else:
            ans += "0"
        if n == 0:
            break
    return ans[::-1]


if __name__ == '__main__':
    print((solve(eval(input()))))
# Original solution
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return list(map(int, input().split()))
sys.setrecursionlimit(10**9)

N = int(eval(input()))
from itertools import accumulate
from bisect import bisect_left

if N==0:
    print((0))
elif N>0:
    even = [0, 1]
    for i in range(1, 21):
        even.append(2**(i*2))
    cum = list(accumulate(even))
    idx = bisect_left(cum, N)
    maxi = cum[idx]-cum[idx-1]
    val = N-cum[idx-1]
    ans = ['1']
    up = maxi
    for i in range(maxi.bit_length()-1):
        up //= 2
        if val>up:
            if i%2==0:
                ans.append('0')
            else:
                ans.append('1')
            val -= up
        else:
            if i%2==0:
                ans.append('1')
            else:
                ans.append('0')
    print((''.join(ans)))
elif N<0:
    N = -N
    even = [0]
    for i in range(21):
        even.append(2**(i*2+1))
    cum = list(accumulate(even))
    idx = bisect_left(cum, N)
    maxi = cum[idx]-cum[idx-1]
    val = N-cum[idx-1]
    ans = ['1']
    up = maxi
    for i in range(maxi.bit_length()-1):
        up //= 2
        if val>up:
            if i%2==0:
                ans.append('0')
            else:
                ans.append('1')
            val -= up
        else:
            if i%2==0:
                ans.append('1')
            else:
                ans.append('0')
    print((''.join(ans)))

# Optimized solution
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return list(map(int, input().split()))
sys.setrecursionlimit(10**9)

N = int(eval(input()))
 
ans = []
for i in range(50):
    if N%2==1:
        ans.append('1')
        if i%2==0:
            N -= 1
        else:
            N += 1
    else:
        ans.append('0')
    N //= 2
    if N==0:
        break
print((''.join(ans[::-1])))
# Original solution
N = int(eval(input()))

ans = ""

while N != 0:
    ans = str(N % 2)+ans
    N = -(N//2)

print((ans if ans != ""else 0))


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

while N:
    ans = str(N % 2)+ans
    N = -(N//2)

print((ans if ans != ""else 0))
# Original solution
n = int(eval(input()))
I = [[0,1]]
while n < I[-1][0] or I[-1][1] < n:
  if len(I)%2 != 0:
    I += [[I[-1][0]-2**(len(I)),I[-1][1]]]
  else:
    I += [[I[-1][0],I[-1][1]+2**(len(I))]]
ans = ''
for i in range(len(I)):
  if abs((I[-i-1][0]+I[-i-1][1])/2) < abs(n) and n * (-1)**(len(I)-i-1) > 0:
    ans += '1'
    n -= (-2)**(len(I)-i-1)
  else:
    ans += '0'
print((int(ans)))

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

lt = [0 for _ in range(50)]
rt = [0 for _ in range(50)]

lt[0] = 1
rt[0] = 1
lt[1] = -2
rt[1] = -1

for i in range(2, 50):
    if i % 2 == 0:
        lt[i] = rt[i - 2] + 1
        rt[i] = lt[i] + 2**i - 1
    else:
        rt[i] = lt[i - 2] - 1
        lt[i] = rt[i] - 2**i + 1


res = [0 for _ in range(50)]
while N:
    for i in range(50):
        if lt[i] <= N <= rt[i]:
            res[~i] = 1
            N -= (-2)**i
            break
            
print((int(''.join(map(str, res)))))
# Original solution
import bisect
n = int(eval(input()))
ps = [0] * (1 << 16)
for i in range(1 << 16):
    temp = 0
    x = 1    
    for j in range(16):
        if (i >> j) & 1:
#                temp += (-2) ** (2 *j)
            temp += x
        x *= 4
    ps[i] = temp

pattern1 = None
pattern2 = None

for i in range(1 << 16):
    temp2 = 0
    x = 2
    for j in range(16):
        if (i >> j) & 1:
#                temp2 += (-2) ** (2 *j + 1)
            temp2 += x
        x *= 4
    n2 = n + temp2
    pattern1 = bisect.bisect_left(ps, n2)
    if pattern1 != (1 << 16) and ps[pattern1] == n2:
        pattern2 = bin(i)[2:].zfill(16)
        pattern1 = bin(pattern1)[2:].zfill(16)
        break

ans = ""
for i in range(16):
    ans += pattern2[i]
    ans += pattern1[i]
    
true_ans = ""
flag = False
for i in range(len(ans)):
    if ans[i]=="1":
        true_ans += "1"
        flag = True
    elif flag:
        true_ans += "0"

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

# Optimized solution
n = int(eval(input()))
n2 = n
ans = ""
for i in range(100):
    while n != 0:
        r = (n % 2)
        n = (n - r) // (-2)
        ans = str(r) + ans
if n2==0:
    print("0")
else:
    print(ans)
# Original solution
import bisect
n = int(eval(input()))
ps = [0] * (1 << 16)
for i in range(1 << 16):
    temp = 0
    for j in range(16):
        if (i >> j) & 1:
                temp += (-2) ** (2 *j)
    ps[i] = temp

pattern1 = None
pattern2 = None

for i in range(1 << 16):
    temp2 = 0
    for j in range(16):
        if (i >> j) & 1:
                temp2 += (-2) ** (2 *j + 1)
    n2 = n - temp2
    pattern1 = bisect.bisect_left(ps, n2)
    if pattern1 != (1 << 16) and ps[pattern1] == n2:
        pattern2 = bin(i)[2:].zfill(16)
        pattern1 = bin(pattern1)[2:].zfill(16)
        break

ans = ""
for i in range(16):
    ans += pattern2[i]
    ans += pattern1[i]
    
true_ans = ""
flag = False
for i in range(len(ans)):
    if ans[i]=="1":
        true_ans += "1"
        flag = True
    elif flag:
        true_ans += "0"

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

# Optimized solution
import bisect
n = int(eval(input()))
ps = [0] * (1 << 16)
for i in range(1 << 16):
    temp = 0
    x = 1    
    for j in range(16):
        if (i >> j) & 1:
#                temp += (-2) ** (2 *j)
            temp += x
        x *= 4
    ps[i] = temp

pattern1 = None
pattern2 = None

for i in range(1 << 16):
    temp2 = 0
    x = -2
    for j in range(16):
        if (i >> j) & 1:
#                temp2 += (-2) ** (2 *j + 1)
            temp2 += x
        x *= 4
    n2 = n - temp2
    pattern1 = bisect.bisect_left(ps, n2)
    if pattern1 != (1 << 16) and ps[pattern1] == n2:
        pattern2 = bin(i)[2:].zfill(16)
        pattern1 = bin(pattern1)[2:].zfill(16)
        break

ans = ""
for i in range(16):
    ans += pattern2[i]
    ans += pattern1[i]
    
true_ans = ""
flag = False
for i in range(len(ans)):
    if ans[i]=="1":
        true_ans += "1"
        flag = True
    elif flag:
        true_ans += "0"

if true_ans == "":
    true_ans = "0"
        
print(true_ans)
# Original solution
import bisect
n = int(eval(input()))
ps = [0] * (1 << 16)
for i in range(1 << 16):
    temp = 0
    x = 1    
    for j in range(16):
        if (i >> j) & 1:
#                temp += (-2) ** (2 *j)
            temp += x
        x *= 4
    ps[i] = temp

pattern1 = None
pattern2 = None

for i in range(1 << 16):
    temp2 = 0
    x = -2
    for j in range(16):
        if (i >> j) & 1:
#                temp2 += (-2) ** (2 *j + 1)
            temp2 += x
        x *= 4
    n2 = n - temp2
    pattern1 = bisect.bisect_left(ps, n2)
    if pattern1 != (1 << 16) and ps[pattern1] == n2:
        pattern2 = bin(i)[2:].zfill(16)
        pattern1 = bin(pattern1)[2:].zfill(16)
        break

ans = ""
for i in range(16):
    ans += pattern2[i]
    ans += pattern1[i]
    
true_ans = ""
flag = False
for i in range(len(ans)):
    if ans[i]=="1":
        true_ans += "1"
        flag = True
    elif flag:
        true_ans += "0"

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

# Optimized solution
import bisect
n = int(eval(input()))
ps = [0] * (1 << 16)
for i in range(1 << 16):
    temp = 0
    x = 1    
    for j in range(16):
        if (i >> j) & 1:
#                temp += (-2) ** (2 *j)
            temp += x
        x *= 4
    ps[i] = temp

pattern1 = None
pattern2 = None

for i in range(1 << 16):
    temp2 = 0
    x = 2
    for j in range(16):
        if (i >> j) & 1:
#                temp2 += (-2) ** (2 *j + 1)
            temp2 += x
        x *= 4
    n2 = n + temp2
    pattern1 = bisect.bisect_left(ps, n2)
    if pattern1 != (1 << 16) and ps[pattern1] == n2:
        pattern2 = bin(i)[2:].zfill(16)
        pattern1 = bin(pattern1)[2:].zfill(16)
        break

ans = ""
for i in range(16):
    ans += pattern2[i]
    ans += pattern1[i]
    
true_ans = ""
flag = False
for i in range(len(ans)):
    if ans[i]=="1":
        true_ans += "1"
        flag = True
    elif flag:
        true_ans += "0"

if true_ans == "":
    true_ans = "0"
        
print(true_ans)
# Original solution
n=int(eval(input()))
t=1
b=''
for i in range(len(bin(n))):
  if n%(2*t): b='1'+b; n-=t
  else: b='0'+b
  t*=-2
print((int(b)))

# Optimized solution
n = int(eval(input()))
b = ''
while n:
  b = str(n%2)+b
  n = -(n//2)
print((b if b else 0))
# Original solution
n=int(input())
deg=[0]*40
if n>=0:
    for i in range(32):
        if n>>i&1:
            if i%2==0:
                deg[i]+=1
                if deg[i]>=2:
                    deg[i+1]+=1
                    deg[i+2]+=1
                    deg[i]-=2
            else:
                deg[i]+=1
                deg[i+1]+=1
                if deg[i]>=2:
                    deg[i+1]-=1
                    deg[i]-=2
                if deg[i+1]>=2:
                    deg[i+2]+=1
                    deg[i+3]+=1
                    deg[i+1]-=2
        else:
            if i%2==0:
                if deg[i]>=2:
                    deg[i+1]+=1
                    deg[i+2]+=1
                    deg[i]-=2
            else:
                if deg[i]>=2:
                    deg[i+1]-=1
                    deg[i]-=2
                if deg[i+1]>=2:
                    deg[i+2]+=1
                    deg[i+3]+=1
                    deg[i+1]-=2
else:
    n*=-1
    for i in range(32):
        if n>>i&1:
            if i%2==1:
                deg[i]+=1
                if deg[i]>=2:
                    deg[i+1]+=1
                    deg[i+2]+=1
                    deg[i]-=2
            else:
                deg[i]+=1
                deg[i+1]+=1
                if deg[i]>=2:
                    deg[i+1]-=1
                    deg[i]-=2
                if deg[i+1]>=2:
                    deg[i+2]+=1
                    deg[i+3]+=1
                    deg[i+1]-=2
        else:
            if i%2==1:
                if deg[i]>=2:
                    deg[i+1]+=1
                    deg[i+2]+=1
                    deg[i]-=2
            else:
                if deg[i]>=2:
                    deg[i+1]-=1
                    deg[i]-=2
                if deg[i+1]>=2:
                    deg[i+2]+=1
                    deg[i+3]+=1
                    deg[i+1]-=2
deg.reverse()
l=39
for i in range(40):
    if deg[i]==1:
        l=i
        break
print(*deg[l:],sep="")


# Optimized solution
n=int(eval(input()))
s=""
while n:
    s=str(n&1)+s
    n=-(n>>1)
print((s if s else 0))
# Original solution
def main():
    N = int(eval(input()))

    def to_bin(n):
        """
        n:10進数 -> 2進数
        """
        if n == 0:
            return 0
        digits = []
        i = 0
        base = 1
        while n != 0:
            if n % (base*2) == 0:
                digits.append("0")
            else:
                digits.append("1")
                n -= base
            i += 1
            base *= -2
        return "".join(digits[::-1])

    print((to_bin(N)))


if __name__ == '__main__':
    main()


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

    def to_bin(n):
        """
        n:10進数 -> 2進数
        """
        if n == 0:
            return 0
        digits = []
        i = 0
        base = 1
        while n != 0:
            if n % (base*-2) == 0:
                digits.append("0")
            else:
                digits.append("1")
                n -= base
            i += 1
            base *= -2
        return "".join(digits[::-1])

    print((to_bin(N)))


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


def basem2(n, ans):
    if n == 0:
        if not ans:
            ans.append(0)
        return ans
    if n > 0:
        p, a, k = 1, 1, 0
        while n > a:
            p *= 4
            a += p
            k += 2
        # print(f"n={n} +{p} bit:{k} => {n-p}")
    else:
        assert n < 0
        p, a, k = -2, -2, 1
        while n < a:
            p *= 4
            a += p
            k += 2
        # print(f"n={n} {p} bit:{k} => {n-p}")
    while len(ans) < k + 1:
        ans.append(0)
    ans[k] = 1
    return basem2(n - p, ans)


print(("".join([str(x) for x in reversed(basem2(N, []))])))


# Optimized solution
N = int(eval(input()))
ans = [0]


def solve(n):
    if n == 0:
        return
    if n > 0:
        p, a, k = 1, 1, 0
    else:
        p, a, k = -2, -2, 1
    while abs(n) > abs(a):
        p *= 4
        a += p
        k += 2
    while len(ans) <= k:
        ans.append(0)
    ans[k] = 1
    solve(n - p)


solve(N)
print(("".join([str(x) for x in reversed(ans)])))
# Original solution
n = int(eval(input()))

i = 1
num = ""
SUM = 0
amari = 1
while not(n == amari == SUM or SUM == n) or num == "":
  amari = n % 2**i
  if amari == SUM % 2**i:
    num += "0"
  else:
    SUM += (-2)**(i-1)
    num += "1"
  i += 1
  #print(amari,SUM)
print((num[::-1]))

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

i = 1
num = ""
SUM = 0
amari = 1
if n == 0:
  num = "0"
while not(n == amari == SUM or SUM == n): #or num == "":
  amari = n % 2**i
  if amari == SUM % 2**i:
    num += "0"
  else:
    SUM += (-2)**(i-1)
    num += "1"
  i += 1
  #print(amari,SUM)
print((num[::-1]))
# Original solution
N = int(eval(input()))

ans = ''
isOdd = False
while N != 0 :
    if N % 2 == 1 :
        ans += '1'
    else :
        ans += '0'
    if isOdd :
        N += 1
    N //= 2
    isOdd = not isOdd

if ans == '' :
    print('0')
else :
    print((ans[::-1]))

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

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

ans = []
while N != 0:
    d = len(ans)
    if N % 2 == 1:
        ans.append('1')
        N -= pow(-1, d)
        N //= 2
    else:
        ans.append('0')
        N //= 2

print((''.join(ans[::-1])))
# Original solution
n = int(eval(input()))
if n == 0:
  print((0))
  exit()
ans = ""
while n != 0:
  if n%-2 < 0:
    r = n%-2+2
    n = n//-2+1
  else:
    r = n%-2
    n = n//-2
  ans += str(r)
print((int(ans[::-1])))

# Optimized solution
n = int(eval(input()))
ans = ""
if n==0:
  print((0))
  exit()
while n!=0:
  n, r = n//(-2), n%(-2)
  if r<0:
    r += 2
    n += 1
  ans += str(r)
print((ans[::-1]))
# Original solution
N = int(eval(input()))
str2N = bin(abs(N))[2:]
S = ''
inc = 0
for i, s in enumerate(str2N[::-1]):
  S += str((int(s) + inc) % 2)
  if N > 0:
    if i % 2 == 0:
      inc = (int(s) + inc) // 2
    else:
      inc = 1 if (int(s) + inc) else 0
  else:
    if i % 2 == 0:
      inc = 1 if (int(s) + inc) else 0
    else:
      inc = (int(s) + inc) // 2
S += str(inc)
if abs(N) > 0:
  S = S[::-1][S[::-1].find('1'):]
  if N > 0:
    if len(S) % 2 == 0:
      S = '1' + S
  else:
    if len(S) % 2 != 0:
      S = '1' + S
  print(S)
else:
  print('0')

# Optimized solution
N = int(eval(input()))
def n_ary_notation(N, n):
  if N == 0:
    return '0'
  else:
    s = ''
    while N:
      s = str(N % abs(n)) + s
      N -= N % abs(n)
      N //= n
    return s
print((n_ary_notation(N, -2)))
# Original solution
import bisect
def put(a,b): #結果の表示
    l=max(len(a),len(b)) #aとbの長さが違うときに壊れるので以下で十分な長さの0を結合しておく
    a="0"*l+a
    b="0"*l+b
    s=""
    for i in range(-1,-l-1,-1): #長さの偶奇を考えたくないので逆順に生成してあとで反転
        s+=a[i]+b[i]
    s=s[-1::-1] #反転
    ind=s.find("1")
    print((s[ind:])) #頭にたくさんついている0を除いて表示

def quad(i): #数値を4進数表記の文字列に直す。16→"100"など。
    s=""
    while i>0:
        s+=str(i%4)
        i//=4
    return s[-1::-1]

l=[0,1]
for i in range(1,18): #候補の生成。最長で18ビット。
    l+=[4**i+j for j in l]

n=int(eval(input()))
if n==0: #n==0は出力が空文字になってしまうので別に扱う
    print("0")
else:
    for i in range(len(l)):
        ind=bisect.bisect_left(l,(l[i]-n)//2)
        if l[i]-2*l[ind]==n:
            put(quad(l[i]),quad(l[ind]))
            break

# Optimized solution
def solve(n):
    ret=""
    i=0
    while True:
        if i%2==1 and n%2==1: #奇数ビットが1のとき
            n+=2
        ret+=str(n%2)
        n//=2
        if n==0:
            break
        i+=1
    return ret[-1::-1] #逆順に結合されているので反転

n=int(eval(input()))
if n==0:
    print((0))
elif n<0: #負数は左ビットシフトして一文字落とす
    print((solve(n*(-2))[:-1]))
else:
    print((solve(n)))
# Original solution
import bisect


def put(a, b):  # 結果の表示
    l = max(len(a), len(b))  # aとbの長さが違うときに壊れるので以下で十分な長さの0を結合しておく
    a = "0" * l + a
    b = "0" * l + b
    s = ""
    for i in range(-1, -l-1, -1):  # 長さの偶奇を考えたくないので逆順に生成してあとで反転
        s += a[i] + b[i]
    s = s[-1::-1]  # 反転
    print((s[s.find("1"):]))  # 頭にたくさんついている0を除いて表示


def quad(i):  # 数値を4進数表記の文字列に直す。16→"100"など。
    s = ""
    while i > 0:
        s += str(i % 4)
        i //= 4
    return s[-1::-1]


l = [0, 1]
for i in range(1, 20):  # 候補の生成。最長で20ビット。
    l += [4 ** i + j for j in l]

n = int(eval(input()))
if n == 0:  # n==0は出力が空文字になってしまうので別に扱う
    print("0")
else:
    for i in range(len(l)):
        ind = bisect.bisect_left(l, (l[i] - n) // 2)
        if l[i] - 2 * l[ind] == n:
            put(quad(l[i]), quad(l[ind]))
            break

# Optimized solution
def solve(n):
    ret = ""
    i = 0  # n%2が元の何ビット目にあたるか
    while True:
        if i % 2 == 1 and n % 2 == 1:  # 奇数ビットが1のとき
            n += 2
        ret += str(n % 2)
        n //= 2  # 1ビット右にずらす
        i += 1
        if n == 0:
            break
    return ret[-1::-1]  # 逆順に結合されているので反転


n = int(eval(input()))
if n == 0:
    print((0))
elif n < 0:  # 負数は左ビットシフト、一文字落として表示
    n *= -2
    print((solve(n)[:-1]))
else:
    print((solve(n)))
# Original solution
n = int(eval(input()))
st = ""

while n != 0:
    r = n % 2
    if r < 0:
        r += 2
    n = int((n - r) / (-2))
    st += str(r)

st = st[::-1]

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

# Optimized solution
n = int(eval(input()))
ans = ""
while n != 0:
    r = n % (-2)
    if r < 0:
        r += 2
    n = int((n - r) / (-2))
    ans += str(r)
if ans == "":
    print((0))
else:
    print((ans[::-1]))
# Original solution
import math

n = int(eval(input()))
if n == 0:
    print((0))
    exit()
out = ""
i = 0
while n != 0:
    if n % -2 != 0:
        out = str(- (n % -2)) + out
        # print("n:{} div:{}=(-2)^{}".format(n, (-2) ** i, i))
    else:
        out = str(- (n % -2)) + out

    # 123->100, -123->-100
    if n > 0:
        n = int(n / (-2))
    else:
        n = math.ceil(n / (-2))
    i += 1
print(out)
"""
tmp = 1
digit = 0
while tmp < n:
    tmp *= 4
    digit += 1
number = [0 for i in range(digit)]
print(number)
tmp = n
for i in range(digit):
    if 0 < tmp % 4 < 4:
        number[i] = tmp % 4
        tmp = int(tmp / 4)
"""


# Optimized solution
import math

# print("{}/{}={} %{}".format(-123, 10, -123/10, -123 %10))
n = int(eval(input()))
if n == 0:
    print((0))
    exit()
out = ""
i = 0
while n != 0:
    if n % -2 != 0:
        out = str(- (n % -2)) + out
        # print("n:{} div:{}=(-2)^{}".format(n, (-2) ** i, i))
    else:
        out = str(- (n % -2)) + out

    # 12 -> 2 + 10^1, -12 -> 8 + 2*(-10)^1
    if n > 0:
        n = int(n / (-2))
    else:
        n = math.ceil(n / (-2))
    i += 1
print(out)
# Original solution
def m(K):return "1" if K==1 else "0" if K==0 else m(-(K-K%2)//2)+str(K%2)
print((m(int(eval(input())))))


# Optimized solution
def m(K):return str(K) if K*K==K else m(-(K-K%2)//2)+str(K%2)
print((m(int(eval(input())))))
# Original solution
N=int(eval(input()));S=""
while(True):
  if N*N==N:S+=str(N);break
  S+=str(N%2);N=(N-N%2)//(-2)
print((S[::-1]))

# Optimized solution
N=int(eval(input()));S=""
while 1:
 if N*N==N:S+=str(N);break
 S+=str(N%2);N=(N-N%2)//(-2)
print((S[::-1]))