#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T power(T base, int p) {
  T f = 1;
  for (int i = 1; i <= p; i++) f *= base;
  return f;
}
template <typename T>
string NumberToString(T Number) {
  ostringstream ss;
  ss << Number;
  return ss.str();
}
int setbit(int N, int pos) { return N = N | (1 << pos); }
int resetbit(int N, int pos) { return N = N & ~(1 << pos); }
bool checkbit(int N, int pos) { return (bool)(N & (1 << pos)); }
int noofsetbits(int N) { return __builtin_popcount(N); }
long long int bigMod(long long int N, long long int M, long long int MOD) {
  if (M == 0) return 1;
  if ((M / 2) * 2 == M) {
    long long int ret = bigMod(N, M / 2, MOD) % MOD;
    return (ret * ret) % MOD;
  } else
    return ((N % MOD) * bigMod(N, M - 1, MOD) % MOD) % MOD;
}
long long int modInverseBigMod(long long int a, long long int m) {
  return bigMod(a, m - 2, m);
}
pair<int, int> extendedEuclid(long long int a, long long int b) {
  if (b == 0) return pair<int, int>(1, 0);
  pair<int, int> d = extendedEuclid(b, a % b);
  return pair<int, int>(d.second, d.first - d.second * (a / b));
}
long long int modularInverse(long long int a, long long int m) {
  pair<int, int> ret = extendedEuclid(a, m);
  return ((ret.first % m) + m) % m;
}
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  if (b < 0) {
    b = (-1) * b;
    for (int i = 1; i <= b; i++) {
      a--;
      if (a == 0) a = n;
    }
  } else {
    for (int i = 1; i <= b; i++) {
      a++;
      if (a == n + 1) a = 1;
    }
  }
  cout << a << endl;
  return 0;
}
