import sys input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(max(1000, 10**9)) write = lambda x: sys.stdout.write(x+"\n") d = int(input()) ans = d def sub(x, k): v = 0 i = 0 while x>0: v += x x //= 2 i += 1 if i>=k: break return v>=d def val(x, k): v = 0 i = 0 while x>0: v += x x //= 2 i += 1 if i>=k: break return v def proc(k): l = 0 r = d while l