#include <bits/stdc++.h>
using namespace std;
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
clock_t start = clock();
int gcd(int a, int b) { return (a == 0) ? b : gcd(b % a, a); }
int power(int a, int n) {
  int p = 1;
  while (n > 0) {
    if (n % 2) {
      p = p * a;
    }
    n >>= 1;
    a *= a;
  }
  return p;
}
int powm(int a, int n, int mod_) {
  int p = 1;
  while (n) {
    if (n % 2) {
      p = (((p % mod_) * 1LL * (a % mod_)) % mod_);
    }
    n >>= 1;
    a = (((a % mod_) * 1LL * (a % mod_)) % mod_);
  }
  return p % mod_;
}
int powi(int a, int mod_) { return powm(a, mod_ - 2, mod_); }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int mn, mx;
  int n, m, k, t, i, j, sum = 0, flag = 0, cnt = 0;
  int x = 0, y = 0, z, l, r, q;
  int TC = 1;
  while (TC--) {
    cin >> n;
    vector<int> a(n);
    for (i = 0; i < n; ++i) cin >> a[i];
    sort((a).begin(), (a).end());
    reverse((a).begin(), (a).end());
    i = n - 1;
    x = -1000000007;
    while (i >= 0 and a[i] <= 0) {
      if (a.back() % 2) x = a.back();
      a.pop_back();
      --i;
    }
    reverse((a).begin(), (a).end());
    n = (int)((a).size());
    sum = accumulate((a).begin(), (a).end(), 0);
    ;
    y = 1000000007;
    i = 0;
    while (i < n) {
      if (a[i] % 2) {
        y = a[i];
        break;
      }
      ++i;
    }
    if (sum % 2)
      cout << sum;
    else {
      cout << max(sum - y, sum + x);
    }
  };
  return 0;
}

### Prompt

Generate a Cpp solution to the following problem:

You are given sequence a1, a2, ..., an of integer numbers of length n. Your task is to find such subsequence that its sum is odd and maximum among all such subsequences. It's guaranteed that given sequence contains subsequence with odd sum.

Subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements.

You should write a program which finds sum of the best subsequence.

Input

The first line contains integer number n (1 ≤ n ≤ 105).

The second line contains n integer numbers a1, a2, ..., an ( - 104 ≤ ai ≤ 104). The sequence contains at least one subsequence with odd sum.

Output

Print sum of resulting subseqeuence.

Examples

Input

4
-2 2 -3 1


Output

3


Input

3
2 -5 -3


Output

-1

Note

In the first example sum of the second and the fourth elements is 3.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
clock_t start = clock();
int gcd(int a, int b) { return (a == 0) ? b : gcd(b % a, a); }
int power(int a, int n) {
  int p = 1;
  while (n > 0) {
    if (n % 2) {
      p = p * a;
    }
    n >>= 1;
    a *= a;
  }
  return p;
}
int powm(int a, int n, int mod_) {
  int p = 1;
  while (n) {
    if (n % 2) {
      p = (((p % mod_) * 1LL * (a % mod_)) % mod_);
    }
    n >>= 1;
    a = (((a % mod_) * 1LL * (a % mod_)) % mod_);
  }
  return p % mod_;
}
int powi(int a, int mod_) { return powm(a, mod_ - 2, mod_); }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int mn, mx;
  int n, m, k, t, i, j, sum = 0, flag = 0, cnt = 0;
  int x = 0, y = 0, z, l, r, q;
  int TC = 1;
  while (TC--) {
    cin >> n;
    vector<int> a(n);
    for (i = 0; i < n; ++i) cin >> a[i];
    sort((a).begin(), (a).end());
    reverse((a).begin(), (a).end());
    i = n - 1;
    x = -1000000007;
    while (i >= 0 and a[i] <= 0) {
      if (a.back() % 2) x = a.back();
      a.pop_back();
      --i;
    }
    reverse((a).begin(), (a).end());
    n = (int)((a).size());
    sum = accumulate((a).begin(), (a).end(), 0);
    ;
    y = 1000000007;
    i = 0;
    while (i < n) {
      if (a[i] % 2) {
        y = a[i];
        break;
      }
      ++i;
    }
    if (sum % 2)
      cout << sum;
    else {
      cout << max(sum - y, sum + x);
    }
  };
  return 0;
}

```