#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  if (b < 0) {
    int counter = 0;
    b = (-1) * b;
    while (true) {
      if (b == counter) {
        break;
      }
      a--;
      counter++;
      if (a == 0) {
        a = n;
      }
    }
    cout << a << endl;
  } else {
    int counter = 0;
    while (true) {
      if (counter == b) {
        break;
      }
      a++;
      a %= n;
      counter++;
    }
    if (a == 0) {
      cout << n << endl;
    } else {
      cout << a << endl;
    }
  }
}
