#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long long mod = 1e9 + 9;
struct str {
  int t, r, c, x;
};
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int n, a, b, f;
  cin >> n >> a >> b;
  if (b > 0)
    f = 1;
  else if (b < 0)
    f = -1;
  else {
    cout << a << endl;
    return 0;
  }
  int k = abs(b);
  while (k > 0) {
    int r = a + (f * 1);
    if (r > n)
      a = 1;
    else if (r < 1)
      a = n;
    else
      a = r;
    k--;
  }
  cout << a << endl;
  return 0;
}
