#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s, t, h = 0, g = 0;
  int a[100];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  cin >> s >> t;
  if (s == t)
    cout << 0;
  else {
    if (s > t) {
      for (int i = t - 1; i < s - 1; i++) g += a[i];
      if (t == 1) {
        for (int i = n - 1; i >= s - 1; i--) h += a[i];
        if (g < h)
          cout << g;
        else
          cout << h;
      } else {
        for (int i = t - 2; i >= 0; i--) h += a[i];
        for (int i = n - 1; i >= s - 1; i--) h += a[i];
        if (g < h)
          cout << g;
        else
          cout << h;
      }
    } else if (t > s) {
      for (int i = s - 1; i < t - 1; i++) g += a[i];
      if (s == 1) {
        for (int i = n - 1; i >= t - 1; i--) h += a[i];
        if (g < h)
          cout << g;
        else
          cout << h;
      } else {
        for (int i = s - 2; i >= 0; i--) h += a[i];
        for (int i = n - 1; i >= t - 1; i--) h += a[i];
        if (g < h)
          cout << g;
        else
          cout << h;
      }
    }
  }
  return 0;
}
