#include <bits/stdc++.h>
using namespace std;
const int N = 4e3 + 7;
int n;
int a[N];
int ps[N];
bool mrk[N][140][70];
int dp[N][140][70];
int get(int a, int d, int k) {
  if (mrk[a][65 + d][k]) return dp[a][65 + d][k];
  mrk[a][65 + d][k] = 1;
  int b = a - d;
  int l = a + 1;
  int r = n - b;
  if (r - l + 1 < k)
    dp[a][65 + d][k] = ps[a] - (ps[n] - ps[r]);
  else if (a <= b) {
    dp[a][65 + d][k] = get(a + k, d + k, k);
    if (r - l + 1 >= k + 1)
      dp[a][65 + d][k] =
          max(dp[a][65 + d][k], get(a + k + 1, d + k + 1, k + 1));
  } else {
    dp[a][65 + d][k] = get(a, d - k, k);
    if (r - l + 1 >= k + 1)
      dp[a][65 + d][k] = min(dp[a][65 + d][k], get(a, d - (k + 1), k + 1));
  }
  return dp[a][65 + d][k];
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    ps[i] = a[i] + ps[i - 1];
  }
  cout << get(0, 0, 1);
  return 0;
}
