#!/usr/bin/ python3.8 import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N = int(read()) dp = [0] * (N + 1) for n in range(1, N + 1): x = n for i in range(1, N + 1): m = n - i * i if m < 0: break y = dp[m] + i if x > y: x = y dp[n] = x def find_next_num_odd(N): for i in range(1, N + 1, 2): m = N - i * i if m < 0: break if dp[N] == dp[m] + i: return i return None def find_next_num_even(N, reverse=True): U = int((N + 1) ** .5) if U & 1: U += 1 rng = range(2, U + 1, 2) if reverse: rng = reversed(rng) for i in rng: m = N - i * i if m < 0: continue if dp[N] == dp[m] + i: return i nums = [] while N: i = find_next_num_odd(N) if not i: break nums.append(i) N -= i * i rev = True while N: i = find_next_num_even(N, rev) rev = not rev nums.append(i) N -= i * i def to_word(N, next_ch): q, r = divmod(N, 2) w = '01' if next_ch == 0 else '10' if r == 0: return w * q else: return w * q + str(next_ch) words = [] next_ch = 0 for n in nums: words.append(to_word(n, next_ch)) if not (n & 1): next_ch ^= 1 answer = ''.join(words) print(answer)