#include <bits/stdc++.h>
using namespace std;
string to_string(string s) { return '"' + s + '"'; }
string to_string(char c) { return '\'' + string(1, c) + '\''; }
string to_string(const char *s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) res += ", ";
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
const int dx[] = {0, 0, 1, -1}, dy[] = {1, -1, 0, 0};
string to_str(const int &n) {
  ostringstream stm;
  stm << n;
  return stm.str();
}
string to_str(const long long &n) {
  ostringstream stm;
  stm << n;
  return stm.str();
}
template <class T>
string tostring(T x, int len = 0) {
  stringstream ss;
  ss << x;
  string r = ss.str();
  if (int((r).size()) < len) r = string(len - int((r).size()), '0') + r;
  return r;
}
template <class T>
void convert(string x, T &r) {
  stringstream ss(x);
  ss >> r;
}
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= 1000000007;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % 1000000007;
    a = a * a % 1000000007;
  }
  return res;
}
long long modinv(long long a) { return powmod(a, 1000000007 - 2); }
long long modinv(long long a, long long m) { return powmod(a, m - 2); }
long long nCkMp(long long n, long long k) {
  long long numerator = 1, denominator = 1;
  for (int i = 0; i < k; i++) numerator = (numerator * (n - i)) % 1000000007;
  for (int i = 1; i <= k; i++) denominator = (denominator * i) % 1000000007;
  return (numerator * modinv(denominator)) % 1000000007;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
int TT = 1, tt;
clock_t t1;
void solve() {
  t1 = clock();
  int n, q, t = 0, ta, tb;
  (cin >> (n));
  vector<int> x, y;
  for (auto i = (0); i < (n); i++) {
    (cin >> (q));
    if (q > 0)
      x.push_back(q);
    else if (q < 0)
      y.push_back(q);
  }
  sort((x).begin(), (x).end());
  sort((y).rbegin(), (y).rend());
  if (int((x).size())) {
    t = accumulate((x).begin(), (x).end(), 0);
    ta = tb = t;
    if (ta % 2 == 0) {
      for (auto i = (0); i < (int((x).size())); i++)
        if (x[i] % 2) {
          ta -= x[i];
          break;
        }
    }
    if (tb % 2 == 0) {
      for (auto i = (0); i < (int((y).size())); i++)
        if (y[i] % 2) {
          tb += y[i];
          break;
        }
    }
    404;
    t = INT_MIN;
    if (ta % 2) t = ta;
    if (tb % 2) t = max(t, tb);
  } else {
    for (auto i = (0); i < (int((y).size())); i++)
      if (y[i] % 2) {
        t = y[i];
        break;
      }
  }
  (cout << (t) << endl);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  for (tt = 0; tt < TT; tt++) solve();
  return EXIT_SUCCESS;
}

### Prompt

Please create a solution in CPP 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;
string to_string(string s) { return '"' + s + '"'; }
string to_string(char c) { return '\'' + string(1, c) + '\''; }
string to_string(const char *s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) res += ", ";
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
const int dx[] = {0, 0, 1, -1}, dy[] = {1, -1, 0, 0};
string to_str(const int &n) {
  ostringstream stm;
  stm << n;
  return stm.str();
}
string to_str(const long long &n) {
  ostringstream stm;
  stm << n;
  return stm.str();
}
template <class T>
string tostring(T x, int len = 0) {
  stringstream ss;
  ss << x;
  string r = ss.str();
  if (int((r).size()) < len) r = string(len - int((r).size()), '0') + r;
  return r;
}
template <class T>
void convert(string x, T &r) {
  stringstream ss(x);
  ss >> r;
}
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= 1000000007;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % 1000000007;
    a = a * a % 1000000007;
  }
  return res;
}
long long modinv(long long a) { return powmod(a, 1000000007 - 2); }
long long modinv(long long a, long long m) { return powmod(a, m - 2); }
long long nCkMp(long long n, long long k) {
  long long numerator = 1, denominator = 1;
  for (int i = 0; i < k; i++) numerator = (numerator * (n - i)) % 1000000007;
  for (int i = 1; i <= k; i++) denominator = (denominator * i) % 1000000007;
  return (numerator * modinv(denominator)) % 1000000007;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
int TT = 1, tt;
clock_t t1;
void solve() {
  t1 = clock();
  int n, q, t = 0, ta, tb;
  (cin >> (n));
  vector<int> x, y;
  for (auto i = (0); i < (n); i++) {
    (cin >> (q));
    if (q > 0)
      x.push_back(q);
    else if (q < 0)
      y.push_back(q);
  }
  sort((x).begin(), (x).end());
  sort((y).rbegin(), (y).rend());
  if (int((x).size())) {
    t = accumulate((x).begin(), (x).end(), 0);
    ta = tb = t;
    if (ta % 2 == 0) {
      for (auto i = (0); i < (int((x).size())); i++)
        if (x[i] % 2) {
          ta -= x[i];
          break;
        }
    }
    if (tb % 2 == 0) {
      for (auto i = (0); i < (int((y).size())); i++)
        if (y[i] % 2) {
          tb += y[i];
          break;
        }
    }
    404;
    t = INT_MIN;
    if (ta % 2) t = ta;
    if (tb % 2) t = max(t, tb);
  } else {
    for (auto i = (0); i < (int((y).size())); i++)
      if (y[i] % 2) {
        t = y[i];
        break;
      }
  }
  (cout << (t) << endl);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  for (tt = 0; tt < TT; tt++) solve();
  return EXIT_SUCCESS;
}

```