Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent.

Today Vasya got bored and decided to take a walk in the yard. Vasya lives in entrance a and he decided that during his walk he will move around the house b entrances in the direction of increasing numbers (in this order entrance n should be followed by entrance 1). The negative value of b corresponds to moving |b| entrances in the order of decreasing numbers (in this order entrance 1 is followed by entrance n). If b = 0, then Vasya prefers to walk beside his entrance. [Image] Illustration for n = 6, a = 2, b =  - 5. 

Help Vasya to determine the number of the entrance, near which he will be at the end of his walk.


-----Input-----

The single line of the input contains three space-separated integers n, a and b (1 ≤ n ≤ 100, 1 ≤ a ≤ n,  - 100 ≤ b ≤ 100) — the number of entrances at Vasya's place, the number of his entrance and the length of his walk, respectively.


-----Output-----

Print a single integer k (1 ≤ k ≤ n) — the number of the entrance where Vasya will be at the end of his walk.


-----Examples-----
Input
6 2 -5

Output
3

Input
5 1 3

Output
4

Input
3 2 7

Output
3



-----Note-----

The first example is illustrated by the picture in the statements.

Difficulty: interview

Starter code:

Solutions:
n, a, b = list(map(int, input().split()))
ans = a + b
while ans < 0:
    ans += n
ans %= n
if ans == 0:
    print(n)
else:
    print(ans)


3

class StdIO:
	def read_int(self):
		return int(self.read_string())

	def read_ints(self, sep=None):
		return [int(i) for i in self.read_strings(sep)]

	def read_float(self):
		return float(self.read_string())

	def read_floats(self, sep=None):
		return [float(i) for i in self.read_strings(sep)]

	def read_string(self):
		return input()

	def read_strings(self, sep=None):
		return self.read_string().split(sep)

io = StdIO()


def main():
	n, a, b = io.read_ints()

	print((a+b-1) % n + 1)


def __starting_point():
	main()

__starting_point()

#!/usr/bin/env python3

try:
    while True:
        n, a, b = list(map(int, input().split()))
        x = (a + b) % n
        print(n if x == 0 else x)

except EOFError:
    pass


a = []

for i in input().split():
    a.append(int(i))

ans = (a[1]+a[2]+a[0])%a[0]
if ans==0:
    ans = a[0]

print(str(ans))


def main():
    n, a, b = map(int, input().split())
    print((a + b - 1 + n) % n + 1)


main()

n,a,b = list(map(int, input().split(" ")))
x = (a+100*n+b)%n
if x == 0:
    print(n)
else:
    print(x)


n, a, b = list(map(int, input().split()))
for i in range(abs(b)):
    a += (1 if b > 0 else -1)
    if a == 0:
        a = n
    if a == n + 1:
        a = 1
print(a)


n, a, b = list(map(int, input().split()))
c = [i for i in range(1, n+1)]
x = c.index(a)
print(c[(x + b) % n])




n, a, b = list(map(int, input().split()))

print((a - 1 + b + n) % n + 1)




def solve():
    N, A, B = list(map(int, input().split()))

    A -= 1
    A += N * 100

    A += B

    A %= N

    A += 1

    print(A)


def __starting_point():
    solve()

__starting_point()

n,m,k=list(map(int,input().split()))
if ((m+k)%n)==0:
    print(n)
else:
    print((m+k)%n)


__author__ = 'User'
n, a, b = map(int, input().split())
a -= 1
a = (a + b) % n
a += 1
print(a)

n, a, b = map(int, input().split())
if (a+b) % n == 0:
    print(n)
else:
    print((a+b)%n)

n, a, b = tuple(map(int, input().split()))
a -= 1
print(((a + b) % n) + 1)


n, a, b = list(map(int, input().split()))
c = (n * 100 + a + b) % n
print([c, n][c == 0])


n,a,b=list(map(int,input().split()))
if b==0:
    print(a)
elif b<0:
    k=abs(b)
    while k!=0:
        a-=1
        if a==0:
            a=n
        k-=1
    print(a)
else:
    k=b
    while k!=0:
        a+=1
        if a>n:
            a=1
        k-=1
    print(a)
            


n, a, b = list(map(int, input().split()))
s = (a + b) % n
if s == 0:
    s = n
print(s)


n, a, b = map(int, input().split())
print((a - 1 + b + 100 * n) % n + 1)

n,a,b = (int(i) for i in input().split())
ans = (a+b)%n
if ans == 0:
    print(n)
else:
    print(ans)

a, b, c = list(map(int, input().split(' ')))

print((((b - 1 + c) % a) + a) % a + 1)


n, a, b = map(int, input().split())
if b > 0:
    for i in range(abs(b)):
        a += 1
        if a == n + 1:
            a = 1
    print(a)
if b < 0:
    for i in range(abs(b)):
        a -= 1
        if a == 0:
            a = n
    print(a)
if b == 0:
    print(a)

(n, a, b) = map(int, input().split())
k = (a + b) % n
print(k if k != 0 else n)

n, a, b = list(map(int, input().split()))
a -= 1
ans = (a + b) % n + 1
print(ans)


n, a, b = list(map(int, input().split()))
c = [0]
for i in range(1, n+1):
    c += [i]
for i in range(1, n+1):
    c += [i]
for i in range(1, n+1):
    c += [i]
print(c[a + n + (b % n)])
    



n, a, b = map(int, input().split())
a -= 1

print (((a + b + n * 1000) % n) + 1)