#include <bits/stdc++.h>
using namespace std;
int n, a, b, ans;
int main() {
  scanf("%d%d%d", &n, &a, &b);
  if (b > 0) {
    ans = a;
    while (b--) {
      ++ans;
      if (ans > n) ans = 1;
    }
  } else if (b < 0) {
    ans = a;
    b *= -1;
    while (b--) {
      --ans;
      if (ans <= 0) ans = n;
    }
  } else
    ans = a;
  printf("%d", ans);
  return 0;
}
