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)

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]))
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)

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]))

-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) +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]))