#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, st, fin, sum1 = 0, sum2 = 0;
  cin >> n;
  int arr[n];
  for (i = 0; i < n; i++) cin >> arr[i];
  cin >> st >> fin;
  i = ((st < fin) ? st : fin) - 1;
  n = st + fin - i - 2;
  for (int j = i; j < n; j++) sum1 += arr[j];
  for (int j = n; j < sizeof(arr) / sizeof(arr[0]); j++) sum2 += arr[j];
  for (int j = 0; j < i; j++) sum2 += arr[j];
  cout << ((sum1 < sum2) ? sum1 : sum2);
  return 0;
}
