#include <bits/stdc++.h>
using namespace std;
int n;
pair<long long, int> a[(int)(2e5 + 10)];
long long sum, res = -(1ll << 63 - 1);
int k;
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; i++)
    cin >> a[i].first, a[i].second = i, sum += a[i].first;
  if (n == 1) {
    cout << a[1].first << endl;
  } else if (n == 2) {
    cout << -(a[1].first + a[2].first) << endl;
  } else if (n == 3) {
    res = a[1].first + a[2].first - a[3].first;
    res = max(res, -a[1].first + (a[2].first + a[3].first));
    cout << res << endl;
  } else {
    sort(a + 1, a + 1 + n);
    k = n / 2;
    if (n % 3 == 1) res = max(res, sum);
    for (int i = 1; i <= n; i++) {
      sum -= a[i].first * 2;
      if (a[i].second % 2 == 0) k--;
      if ((n + i) % 3 == 1) {
        if ((k == 0 && i == n / 2) || (k == n / 2 && i == (n + 1) / 2)) {
          sum += a[i].first * 2;
          sum -= a[i + 1].first * 2;
          res = max(res, sum);
          sum += a[i + 1].first * 2;
          sum -= a[i].first * 2;
        } else
          res = max(res, sum);
      }
    }
    cout << res << endl;
  }
}
