#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline void mine(T1 &x, T2 y) {
  if (x > y) x = y;
}
template <typename T1, typename T2>
inline void maxe(T1 &x, T2 y) {
  if (x < y) x = y;
}
ostream &operator<<(ostream &a, const vector<long long> &b) {
  for (auto k : b) cout << k << ' ';
  return a;
}
const long long MOD = 1000000007;
const long long INF = 1000000050;
const long long BIG = (long long)2e18 + 50;
const long long MX = 200010;
const double EPS = 1e-9;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
pair<long long, long long> a[MX];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, s = 0;
  cin >> n;
  for (long long i = 0; i < n; ++i) {
    cin >> a[i].first;
    a[i].second = i;
    s += a[i].first;
  }
  if (n == 1) {
    cout << a[0].first << '\n';
    return 0;
  }
  if (n == 2) {
    cout << -a[0].first - a[1].first << '\n';
    return 0;
  }
  if (n == 3) {
    cout << a[0].first + a[1].first + a[2].first -
                2 * min(a[0].first, a[2].first)
         << '\n';
    return 0;
  }
  long long r = ((2 - n) % 3 + 3) % 3;
  sort(a, a + n);
  reverse(a, a + n);
  long long cs = 0;
  long long it = 0;
  long long ans = -BIG;
  bool allo = true;
  bool alle = true;
  for (long long i = r; i <= n; i += 3) {
    while (it < i) {
      allo &= a[it].second % 2 == 1;
      alle &= a[it].second % 2 == 0;
      cs += a[it++].first;
    }
    long long cur = cs;
    long long delta = (it > 0 ? a[it].first - a[it - 1].first : BIG);
    if (n % 2 && i == n / 2 && allo) {
      cur += delta;
    }
    if (n % 2 && i == n / 2 + 1 && alle) {
      cur += delta;
    }
    if (n % 2 == 0 && i == n / 2 && (allo || alle)) {
      cur += delta;
    }
    maxe(ans, cur - (s - cur));
  }
  assert(abs(ans) < 1e15);
  cout << ans << '\n';
}
