#include <bits/stdc++.h>
using namespace std;
inline long long bp(long long a, long long b) {
  if (b == 0) return 1;
  if (b & 1) return (a * bp(a, b - 1)) % 1000000007;
  long long x = bp(a, b / 2);
  return (x * x) % 1000000007;
}
long long ar[200005], dp[200005];
map<long long, long long> m;
inline long long solve(long long a, long long b) {
  if (a == 0) return dp[b];
  return dp[b] - dp[a - 1];
}
inline long long go(long long val, long long ini, long long n) {
  long long cu = ini - val;
  cu += 10 * n;
  return cu % n + 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  long long n;
  cin >> n;
  for (long long(i) = (0); (i) < (n); (i)++) cin >> ar[i];
  for (long long(i) = (n); (i) < (2 * n); (i)++) ar[i] = ar[i - n];
  for (long long(i) = (0); (i) < (2 * n); (i)++)
    dp[i] = (i == 0) ? ar[i] : dp[i - 1] + ar[i];
  long long ini, fin;
  cin >> ini >> fin;
  long long id1 = 0, id2 = fin - ini - 1;
  long long ans = 0, l, r;
  for (long long(i) = (0); (i) < (2 * n); (i)++) {
    if (id2 + i == 2 * n) break;
    long long cur = solve(id1 + i, id2 + i);
    if (cur > ans) {
      ans = cur;
      l = id1 + i;
      r = id2 + i;
    }
  }
  vector<long long> v, v1;
  for (long long(i) = (0); (i) < (2 * n); (i)++) {
    if (id2 + i == 2 * n) break;
    long long cur = solve(id1 + i, id2 + i);
    if (ans == cur) {
      v.push_back({id1 + i});
    }
  }
  for (auto xd : v) {
    long long val = go(xd + 1, ini, n);
    v1.push_back(val);
  }
  sort((v1).begin(), (v1).end());
  cout << v1[0] << endl;
  return 0;
}
