14228 - 2024_IDS_Spring_Lab2_Josephus Problem   

Description

Consider a game where there are n children (numbered 1,2,⋯ ,n) in a circle. During the game, every second child is removed from the circle, until there are no children left. Counting begins at child 1 in the circle and proceeds around the circle in clockwise direction (where the number of the children is increasing except child n and child 1). In which order will the children be removed?

Input

The only input line has an integer nn.

Constraints

  • 1≤n≤2⋅105

Output

Print n integers: the removal order.

Do not include any spaces at the end of line.

Sample Input  Download

Sample Output  Download

Tags




Discuss