#include <bits/stdc++.h>
using namespace std;
int _mergeSort(int arr[], int temp[], int left, int right);
int merge(int arr[], int temp[], int left, int mid, int right);
int mergeSort(int arr[], int array_size) {
  int *temp = (int *)malloc(sizeof(int) * array_size);
  return _mergeSort(arr, temp, 0, array_size - 1);
}
int _mergeSort(int arr[], int temp[], int left, int right) {
  int mid, inv_count = 0;
  if (right > left) {
    mid = (right + left) / 2;
    inv_count = _mergeSort(arr, temp, left, mid);
    inv_count += _mergeSort(arr, temp, mid + 1, right);
    inv_count += merge(arr, temp, left, mid + 1, right);
  }
  return inv_count;
}
int merge(int arr[], int temp[], int left, int mid, int right) {
  int i, j, k;
  int inv_count = 0;
  i = left;
  j = mid;
  k = left;
  while ((i <= mid - 1) && (j <= right)) {
    if (arr[i] <= arr[j]) {
      temp[k++] = arr[i++];
    } else {
      temp[k++] = arr[j++];
      inv_count = inv_count + (mid - i);
    }
  }
  while (i <= mid - 1) temp[k++] = arr[i++];
  while (j <= right) temp[k++] = arr[j++];
  for (i = left; i <= right; i++) arr[i] = temp[i];
  return inv_count;
}
int main() {
  int ic, n, i, m, l, r;
  cin >> n;
  int a[n + 5];
  for (i = 0; i < n; i++) cin >> a[i];
  ic = mergeSort(a, n);
  if (ic % 2 == 0)
    ic = 0;
  else
    ic = 1;
  cin >> m;
  while (m--) {
    cin >> l >> r;
    int ss = r - l + 1;
    ss = floor(ss / 2);
    if (ss % 2 == 1) {
      if (ic)
        ic = 0;
      else
        ic = 1;
    } else {
      if (ic)
        ic = 1;
      else
        ic = 0;
    }
    if (ic)
      cout << "odd"
           << "\n";
    else
      cout << "even"
           << "\n";
  }
  return 0;
}

### 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;
int _mergeSort(int arr[], int temp[], int left, int right);
int merge(int arr[], int temp[], int left, int mid, int right);
int mergeSort(int arr[], int array_size) {
  int *temp = (int *)malloc(sizeof(int) * array_size);
  return _mergeSort(arr, temp, 0, array_size - 1);
}
int _mergeSort(int arr[], int temp[], int left, int right) {
  int mid, inv_count = 0;
  if (right > left) {
    mid = (right + left) / 2;
    inv_count = _mergeSort(arr, temp, left, mid);
    inv_count += _mergeSort(arr, temp, mid + 1, right);
    inv_count += merge(arr, temp, left, mid + 1, right);
  }
  return inv_count;
}
int merge(int arr[], int temp[], int left, int mid, int right) {
  int i, j, k;
  int inv_count = 0;
  i = left;
  j = mid;
  k = left;
  while ((i <= mid - 1) && (j <= right)) {
    if (arr[i] <= arr[j]) {
      temp[k++] = arr[i++];
    } else {
      temp[k++] = arr[j++];
      inv_count = inv_count + (mid - i);
    }
  }
  while (i <= mid - 1) temp[k++] = arr[i++];
  while (j <= right) temp[k++] = arr[j++];
  for (i = left; i <= right; i++) arr[i] = temp[i];
  return inv_count;
}
int main() {
  int ic, n, i, m, l, r;
  cin >> n;
  int a[n + 5];
  for (i = 0; i < n; i++) cin >> a[i];
  ic = mergeSort(a, n);
  if (ic % 2 == 0)
    ic = 0;
  else
    ic = 1;
  cin >> m;
  while (m--) {
    cin >> l >> r;
    int ss = r - l + 1;
    ss = floor(ss / 2);
    if (ss % 2 == 1) {
      if (ic)
        ic = 0;
      else
        ic = 1;
    } else {
      if (ic)
        ic = 1;
      else
        ic = 0;
    }
    if (ic)
      cout << "odd"
           << "\n";
    else
      cout << "even"
           << "\n";
  }
  return 0;
}

```