There are people in a room. They want to play a game called “pass the parcel”.
The people are numbered from to .
If person has the parcel in second, he gives it to the person in second.
where
For example, At second, the person has the parcel. The next second (, he gives the parcel to the person. And the next second, he gives it to person and so on. And when the has the parcel he gives it to the person in next second. And again person gives it to person in next second. It will continue this way.
You will be given an integer . You have to answer who will have the parcel in the second.
The first (and the only) input line contains two integers and — number of people, and time respectively.
Print the number of the person, who will have the parcel in the second, in a single line.
Input | Output |
---|---|
2 2 | 0 |
Input | Output |
---|---|
3 5 | 2 |