#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char ch = getchar();
  int x = 0, f = 1;
  while (ch < '0' || ch > '9') f = ch == '-' ? -1 : 1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * f;
}
const int MAXN = 200010;
struct node {
  int i;
  long long v;
} arr[MAXN];
bool cmp(const node &a, const node &b) { return a.v < b.v; }
long long pre[MAXN];
int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n = read();
  for (int i = (1); i <= (n); i += (1)) arr[i].i = i, arr[i].v = read();
  if (n == 1) {
    printf("%lld\n", arr[1].v);
    return 0;
  }
  sort(arr + 1, arr + n + 1, cmp);
  pre[0] = 0;
  for (int i = (1); i <= (n); i += (1)) pre[i] = pre[i - 1] + arr[i].v;
  int k = (4 - n % 3) % 3;
  long long res = -0x3f3f3f3f3f3f3f3fll;
  for (int i = (k); i <= (n); i += (3)) {
    long long cur = -pre[i] + pre[n] - pre[i];
    if (i == n / 2 || i == n / 2 + (n & 1)) {
      int cnt[2] = {0, 0};
      for (int j = (1); j <= (i); j += (1)) cnt[arr[j].i & 1]++;
      if (cnt[0] == n / 2 && cnt[1] == 0)
        cur += 2 * arr[i].v - 2 * arr[i + 1].v;
      else if (cnt[1] == n / 2 + (n & 1) && cnt[0] == 0)
        cur += 2 * arr[i].v - 2 * arr[i + 1].v;
    }
    res = max(res, cur);
  }
  printf("%lld\n", res);
  return 0;
}
