$N$ cows ($3 \le N \le 250$) sit in a perfect circle around a campfire. For convenience the cows are numbered $1$ through $N$, and the chairs are likewise numbered $1$ through $N$; initially cow $i$ sits in chair $i$.
After one of Farmer John's stories ends, he suggests a Bovine Fire Drill.
In a Bovine Fire Drill, only one cow moves at a time. When it is cow $i$'s turn, she stands up and walks clockwise to the chair that is $i$ positions away from the chair she is sitting in. (For example, if it is cow $3$'s turn, she moves three chairs clockwise from where she is.)
When cow $i$ reaches her new chair, she taps the cow sitting there on the shoulder. That cow stands up to make room, cow $i$ sits down, and the cow who just stood up takes the next turn, moving in the same way.
The process continues until one of the following happens:
Because cow $1$ always moves first, the empty chair is always the chair where cow $1$ originally sat.
Thanks to the properties of whole numbers the drill usually ends early, so it is rare for every cow to take part. The last cow to move — whether she ends the drill by sitting in the empty chair $1$ or by tapping a cow that has already moved — receives a special treat of tender spring grass.
Help Farmer John figure out in advance which cow will receive the treat.
For example, suppose five cows are sitting around the campfire. Below, * marks the empty chair.
2 - 3
( )
1 - 5 - 4
First, cow $1$ walks one chair and taps cow $2$, who stands up.
2
1 - 3
( )
* - 5 - 4
Cow $2$ walks two chairs and taps cow $4$, who begins her journey.
1 - 3
( )
* - 5 - 2
4
Cow $4$ walks four chairs and taps cow $3$.
3
1 - 4
( )
* - 5 - 2
Finally, cow $3$ walks three chairs to the empty chair $1$, which ends the drill.
1 - 4
( )
3 - 5 - 2
Cow $3$ receives tender spring grass as the other cows clap and cheer.
The first line contains the integer $N$.
Print the number of the cow who ends the drill.