Yesterday, the CS Club hosted a massive party that put all the frat parties to shame.  Today, they have to clean up everything.  They also have to restock the strategic supply of Mountain Dew.  Phillip hates cleaning and wants to pick up the dew instead.  He knows that they intend to distribute the chores by having everyone get a number between 1 and the number of people who actually stayed to help clean up.  Once everyone has a number, they will start with the person who has number "1" and skip some number of people.  The person who they land on will be given a specific cleaning task.  The last person picked will not have to clean and will instead get the Dew.  Help Phillip avoid work by creating a program that will take in the number of people participating and the number skipped and output which number Phillip should get in order to the last to get a chore.
 

Input
The number of people playing and the number being skipped.

Output
The number that will be picked last.
Tips:

Here  is a website that visualizes this problem 


Example
Input:
41 3

Output:
31
 

Explanation
Example case 1. ...
import sys
def josephus(n,k):
    if n==1:
        return 1
    else:
        return (josephus(n-1,k)+k-1)%n+1
n,k=map(int,sys.stdin.readline().split())
sys.stdout.write("%d"%josephus(n,k))