#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e6 + 100;
const long long INF = 9 * (long long)(1e18);
const long double PI = 3.14159265358979323846;
long long int modexp(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  if (y == 0)
    return 1;
  else if (x == 0)
    return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res % p;
}
vector<long long int> fact(N + 1, 1);
void factmod(long long int n, long long int k) {
  for (long long int i = 2; i <= n; i++) fact[i] = (i * fact[i - 1]) % k;
}
vector<long long int> invfact(N + 1, 1);
void factinvmod(long long int n, long long int k) {
  for (long long int i = 2; i <= n; i++) {
    invfact[i] = modexp(fact[i], k - 2, k);
  }
}
long long int ncrmod(long long int n, long long int r, long long int k) {
  return (((fact[n] * invfact[n - r]) % k) * invfact[r]) % k;
}
vector<long long int> is_prime(N + 1, 1);
void sieve(long long int n) {
  for (long long int i = 1; i <= n; i++) is_prime[i] = i;
  for (long long int i = 2; i * i <= n; i++) {
    if (is_prime[i] == i) {
      for (long long int j = i * i; j <= n; j += i) {
        is_prime[j] = min(i, is_prime[j]);
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  long long int arr[n];
  for (long long int i = 0; i <= n - 1; i++) cin >> arr[i];
  long long int m;
  cin >> m;
  long long int curr = 0;
  for (long long int i = 0; i <= n - 1; i++) {
    for (long long int j = i + 1; j <= n - 1; j++) {
      if (arr[j] < arr[i]) curr++;
    }
  }
  long long int ans;
  if (curr % 2)
    ans = 1;
  else
    ans = 0;
  while (m--) {
    long long int l, r;
    cin >> l >> r;
    if (((r - l + 1) / 2) % 2) ans = ans ^ 1;
    if (ans % 2)
      cout << "odd"
           << "\n";
    else
      cout << "even"
           << "\n";
  }
}

### Prompt

Generate a CPP solution to the following problem:

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;
const int N = (int)1e6 + 100;
const long long INF = 9 * (long long)(1e18);
const long double PI = 3.14159265358979323846;
long long int modexp(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  if (y == 0)
    return 1;
  else if (x == 0)
    return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res % p;
}
vector<long long int> fact(N + 1, 1);
void factmod(long long int n, long long int k) {
  for (long long int i = 2; i <= n; i++) fact[i] = (i * fact[i - 1]) % k;
}
vector<long long int> invfact(N + 1, 1);
void factinvmod(long long int n, long long int k) {
  for (long long int i = 2; i <= n; i++) {
    invfact[i] = modexp(fact[i], k - 2, k);
  }
}
long long int ncrmod(long long int n, long long int r, long long int k) {
  return (((fact[n] * invfact[n - r]) % k) * invfact[r]) % k;
}
vector<long long int> is_prime(N + 1, 1);
void sieve(long long int n) {
  for (long long int i = 1; i <= n; i++) is_prime[i] = i;
  for (long long int i = 2; i * i <= n; i++) {
    if (is_prime[i] == i) {
      for (long long int j = i * i; j <= n; j += i) {
        is_prime[j] = min(i, is_prime[j]);
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  long long int arr[n];
  for (long long int i = 0; i <= n - 1; i++) cin >> arr[i];
  long long int m;
  cin >> m;
  long long int curr = 0;
  for (long long int i = 0; i <= n - 1; i++) {
    for (long long int j = i + 1; j <= n - 1; j++) {
      if (arr[j] < arr[i]) curr++;
    }
  }
  long long int ans;
  if (curr % 2)
    ans = 1;
  else
    ans = 0;
  while (m--) {
    long long int l, r;
    cin >> l >> r;
    if (((r - l + 1) / 2) % 2) ans = ans ^ 1;
    if (ans % 2)
      cout << "odd"
           << "\n";
    else
      cout << "even"
           << "\n";
  }
}

```