https://www.acmicpc.net/problem/2164
https://github.com/stellaluminary/Baekjoon
from collections import deque
c = deque([i for i in range(1, int(input()) + 1)])
while len(c) != 1:
t = c.popleft()
c.append(c.popleft())
print(c.popleft())
a,b = int(input()), 1
while a>b:
b*=2
print(a*2-b)