#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k, f = 0, l = 0, h = 0, x = 0;
  int a[100];
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    f = f + a[i];
  }
  cin >> m >> k;
  if (m > k) {
    x = m;
    h = k;
  } else {
    x = k;
    h = m;
  }
  for (int i = h; i < x; i++) {
    l = l + a[i];
  }
  if (f - l > l) {
    cout << l;
  } else {
    cout << f - l;
  }
}
