#include <bits/stdc++.h>
using namespace std;
double exact(long long int a, long long int b) { return (double)a / b; }
long long int gcd(long long int a, long long int b) {
  if (a == 0 || b == 0) {
    return (a + b);
  }
  return gcd(b, a % b);
}
long long int fastExpo(long long int a, long long int n, long long int mod) {
  long long int result = 1;
  while (n > 0) {
    if (n & 1) result = (result * a) % mod;
    a = (a * a) % mod;
    n >>= 1;
  }
  return result;
}
long long int modInverse(long long int n, long long int mod) {
  return fastExpo(n, mod - 2, mod);
}
vector<long long int> factorial(long long int n) {
  std::vector<long long int> fac(n + 2, 0);
  fac[0] = 1;
  for (long long int i = 1; i <= n; i++) fac[i] = (fac[i - 1] * i) % 1000000007;
  return fac;
}
long long int __nCr(long long int n, long long int r,
                    vector<long long int>& Fact, long long int mod) {
  long long int ans = (((Fact[n] * modInverse(Fact[r], mod)) % mod) *
                       modInverse(Fact[n - r], mod)) %
                      mod;
  return ans;
}
vector<long long int> sieve(long long int n) {
  vector<long long int> v(n + 2, 0);
  vector<long long int> primes;
  n++;
  v[0] = 1;
  for (long long int i = 2; i < n; i++) {
    if (!v[i]) {
      primes.push_back(i);
      for (long long int j = 2 * i; j < n; j += i) v[j]++;
    }
  }
  return primes;
}
void solve(long long int T) {
  long long int n;
  cin >> n;
  vector<long long int> arr(n);
  for (long long int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  long long int m;
  cin >> m;
  vector<pair<long long int, long long int>> v;
  for (long long int i = 0; i < m; i++) {
    long long int l, r;
    cin >> l >> r;
    v.push_back({l, r});
  }
  long long int c = 0;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = i + 1; j < n; j++) {
      if (arr[i] > arr[j]) {
        c++;
      }
    }
  }
  for (long long int i = 0; i < m; i++) {
    long long int l = v[i].first, r = v[i].second;
    long long int curr = r - l + 1;
    curr = (curr * (curr - 1)) / 2;
    c = c - curr;
    if ((c) % 2 == 0) {
      cout << "even" << endl;
    } else {
      cout << "odd" << endl;
    }
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int T = 1;
  for (long long int t = 1; t <= T; t++) {
    solve(t);
  }
  cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
  return 0;
}

### Prompt

Develop a solution in CPP to the problem described below:

A permutation of size n is an array of size n such that each integer from 1 to n occurs exactly once in this array. An inversion in a permutation p is a pair of indices (i, j) such that i > j and ai < aj. For example, a permutation [4, 1, 3, 2] contains 4 inversions: (2, 1), (3, 1), (4, 1), (4, 3).

You are given a permutation a of size n and m queries to it. Each query is represented by two indices l and r denoting that you have to reverse the segment [l, r] of the permutation. For example, if a = [1, 2, 3, 4] and a query l = 2, r = 4 is applied, then the resulting permutation is [1, 4, 3, 2].

After each query you have to determine whether the number of inversions is odd or even.

Input

The first line contains one integer n (1 ≤ n ≤ 1500) — the size of the permutation. 

The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ n) — the elements of the permutation. These integers are pairwise distinct.

The third line contains one integer m (1 ≤ m ≤ 2·105) — the number of queries to process.

Then m lines follow, i-th line containing two integers li, ri (1 ≤ li ≤ ri ≤ n) denoting that i-th query is to reverse a segment [li, ri] of the permutation. All queries are performed one after another.

Output

Print m lines. i-th of them must be equal to odd if the number of inversions in the permutation after i-th query is odd, and even otherwise.

Examples

Input

3
1 2 3
2
1 2
2 3


Output

odd
even


Input

4
1 2 4 3
4
1 1
1 4
1 4
2 3


Output

odd
odd
odd
even

Note

The first example:

  1. after the first query a = [2, 1, 3], inversion: (2, 1); 
  2. after the second query a = [2, 3, 1], inversions: (3, 1), (3, 2). 



The second example:

  1. a = [1, 2, 4, 3], inversion: (4, 3); 
  2. a = [3, 4, 2, 1], inversions: (3, 1), (4, 1), (3, 2), (4, 2), (4, 3); 
  3. a = [1, 2, 4, 3], inversion: (4, 3); 
  4. a = [1, 4, 2, 3], inversions: (3, 2), (4, 2). 

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
double exact(long long int a, long long int b) { return (double)a / b; }
long long int gcd(long long int a, long long int b) {
  if (a == 0 || b == 0) {
    return (a + b);
  }
  return gcd(b, a % b);
}
long long int fastExpo(long long int a, long long int n, long long int mod) {
  long long int result = 1;
  while (n > 0) {
    if (n & 1) result = (result * a) % mod;
    a = (a * a) % mod;
    n >>= 1;
  }
  return result;
}
long long int modInverse(long long int n, long long int mod) {
  return fastExpo(n, mod - 2, mod);
}
vector<long long int> factorial(long long int n) {
  std::vector<long long int> fac(n + 2, 0);
  fac[0] = 1;
  for (long long int i = 1; i <= n; i++) fac[i] = (fac[i - 1] * i) % 1000000007;
  return fac;
}
long long int __nCr(long long int n, long long int r,
                    vector<long long int>& Fact, long long int mod) {
  long long int ans = (((Fact[n] * modInverse(Fact[r], mod)) % mod) *
                       modInverse(Fact[n - r], mod)) %
                      mod;
  return ans;
}
vector<long long int> sieve(long long int n) {
  vector<long long int> v(n + 2, 0);
  vector<long long int> primes;
  n++;
  v[0] = 1;
  for (long long int i = 2; i < n; i++) {
    if (!v[i]) {
      primes.push_back(i);
      for (long long int j = 2 * i; j < n; j += i) v[j]++;
    }
  }
  return primes;
}
void solve(long long int T) {
  long long int n;
  cin >> n;
  vector<long long int> arr(n);
  for (long long int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  long long int m;
  cin >> m;
  vector<pair<long long int, long long int>> v;
  for (long long int i = 0; i < m; i++) {
    long long int l, r;
    cin >> l >> r;
    v.push_back({l, r});
  }
  long long int c = 0;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = i + 1; j < n; j++) {
      if (arr[i] > arr[j]) {
        c++;
      }
    }
  }
  for (long long int i = 0; i < m; i++) {
    long long int l = v[i].first, r = v[i].second;
    long long int curr = r - l + 1;
    curr = (curr * (curr - 1)) / 2;
    c = c - curr;
    if ((c) % 2 == 0) {
      cout << "even" << endl;
    } else {
      cout << "odd" << endl;
    }
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int T = 1;
  for (long long int t = 1; t <= T; t++) {
    solve(t);
  }
  cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
  return 0;
}

```