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