#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, s1, s2, a[100], min, sum;
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  cin >> s1 >> s2;
  s1--;
  s2--;
  i = s1;
  sum = 0;
  while (i != s2) {
    sum += a[i];
    i = (i + 1) % n;
  }
  min = sum;
  i = s1;
  sum = 0;
  while (i != s2) {
    i = (i - 1 == -1) ? n - 1 : i - 1;
    sum += a[i];
  }
  if (sum < min)
    cout << sum;
  else
    cout << min;
  return 0;
}
