There are n people in a room. They want to play a game called “pass the parcel”.
The people are numbered from 0 to n−1.
If ith person has the parcel in tth second, he gives it to the jth person in (t+1)th second.
where j={i+1; if 0≤i≤n−20; otherwise
For example, At 0th second, the 0th person has the parcel. The next second (1st), he gives the parcel to the 1st person. And the next second, he gives it to 2nd person and so on. And when the (n−1)th has the parcel he gives it to the 0th person in next second. And again 0th person gives it to 1st person in next second. It will continue this way.
You will be given an integer k. You have to answer who will have the parcel in the kth second.
Input
The first (and the only) input line contains two integers n(1≤n≤1000) and k(0≤k≤1000)— number of people, and time respectively.
Output
Print the number of the person, who will have the parcel in the kth second, in a single line.