Problem: Singh is getting bored at work. He has a lot of ideas (N) to work on (as side projects) but is unable to choose one.

He chooses a random number (R) and lines up his ideas in a circle. He starts counting from first and removes the R^th idea in the circle until only one remains. Help him choose an idea to work on.

Input Format:

no_of_ideas random_number

Output Format:

idea_number

Constraints:

1 ≤ N ≤ 20

1 ≤ R ≤ 10000000

SAMPLE INPUT
5 3

SAMPLE OUTPUT
4

Explanation

List: {1,2,3,4,5}. Start counting from 1,

1 2 3 -> 3 removed

4 5 1 -> 1 removed

2 4 5 -> 5 removed

2 4 2 -> 2 removed

Remaining number: 4

Solution (in PYTHON):

Solution:
# -*- coding: utf-8 -*-
"""
Created on Fri Jul  3 19:24:47 2015

@author: ishank011
"""

n, r = map(int, raw_input().split())
l=[i for i in range(1, n+1)]
i=0
while(len(l)!=1):
    i+=(r-1)
    if(i>=len(l)):
        i=i%len(l)
    del l[i]
print l[0]