#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(2);
  cout << fixed;
  int n, a, b;
  cin >> n >> a >> b;
  int p = (b % n);
  if (p == 0)
    cout << a << endl;
  else if (p < 0) {
    int m = (a + n + p) % n;
    if (m == 0)
      cout << n << endl;
    else
      cout << m << endl;
  } else {
    int m = (a + p) % n;
    if (m == 0)
      cout << n << endl;
    else
      cout << m << endl;
  }
  return 0;
}
