#include <bits/stdc++.h>
using namespace std;
int main() {
  int d[110];
  int n, s, t, s1 = 0, s2 = 0, s3;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &d[i]);
  }
  scanf("%d %d", &s, &t);
  if (s < t) {
    for (int i = s; i < t; i++) s1 = s1 + d[i];
    for (int i = s - 1; i >= 1; i--) s2 = s2 + d[i];
    for (int i = n; i >= t; i--) s2 = s2 + d[i];
  } else if (s > t) {
    for (int i = t; i < s; i++) s1 = s1 + d[i];
    for (int i = t - 1; i >= 1; i--) s2 = s2 + d[i];
    for (int i = n; i >= s; i--) s2 = s2 + d[i];
  } else {
    s1 = 0;
    s2 = 0;
  }
  if (s1 >= s2)
    s3 = s2;
  else
    s3 = s1;
  printf("%d\n", s3);
  return 0;
}
