codeparrot/codecomplex huggingface dataset:
// Problem: 909_C. Python Indentation
// Time complexity: quadratic
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class C {

	static int N;
	static char[] a;
	static int[][] memo;
	static int[] ind;
	static final int MOD = (int) 1e9 + 7;
	
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		N = sc.nextInt(); a = new char[N];
		for(int i = 0; i < N; i++) a[i] = sc.nextChar();
		
		if(N == 1){out.println(1); out.flush(); return;}
		memo = new int[N][N + 5];
		for(int[] a : memo) Arrays.fill(a, -1);
		
		out.println(dp(0, 1));
		out.flush();
		out.close();
	}
	
	static int dp(int i, int ind)
	{
		if(i == N - 1) return a[i - 1] == 'f'? 1 : ind;
		if(i == 0) return dp(i + 1, a[i] == 's'? 1 : 2);
		if(memo[i][ind] != -1) return memo[i][ind];
		int ans = 0;
		if(a[i - 1] == 'f')
			ans = dp(i + 1, a[i] == 's'? ind : ind + 1);
		else
		{
			if(ind > 1)
				ans = (ans + dp(i, ind -1)) % MOD;
			ans = (ans + dp(i + 1, a[i] == 's'? ind : ind + 1)) % MOD;
		}
		return memo[i][ind] = ans;
	}

	static class Scanner 
	{
		StringTokenizer st;
		BufferedReader br;

		Scanner(InputStream system) {br = new BufferedReader(new InputStreamReader(system));}
		Scanner(String file) throws FileNotFoundException {br = new BufferedReader(new FileReader(file));}
		String next() throws IOException 
		{
			while (st == null || !st.hasMoreTokens()) 
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		String nextLine()throws IOException{return br.readLine();}
		int nextInt() throws IOException {return Integer.parseInt(next());}
		double nextDouble() throws IOException {return Double.parseDouble(next());}
		char nextChar()throws IOException{return next().charAt(0);}
		Long nextLong()throws IOException{return Long.parseLong(next());}
		boolean ready() throws IOException{return br.ready();}
		void waitForInput(){for(long i = 0; i < 3e9; i++);}
	}
}
// Problem: 909_C. Python Indentation
// Time complexity: quadratic
import java.io.PrintWriter;
import java.util.*;

/**
 * Created by trung.pham on 28/12/17.
 */
public class C_Round_455_Div2 {
    static long[][]dp;

    static  long MOD =(long) 1e9 + 7;
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        char[]data = new char[n];
        dp = new long[n][n];
        for(long []a : dp){
            Arrays.fill(a,-1);
        }
        for(int i = 0; i < n; i++){
            data[i] = in.next().charAt(0);
        }
        out.println(cal(0, 0, data));

        out.close();
    }

    static long cal(int index, int nested, char[]data ){
        //System.out.println(index + " " + nested);
        if(index + 1 == data.length){
            return 1;
        }
        if(dp[index][nested] != -1){
            return dp[index][nested];
        }
        long result = 0;
        boolean isLoop = data[index] == 'f';
        if(isLoop){
            result = cal(index + 1, nested + 1, data);
        }else{
            result = cal(index + 1, nested, data);
            if(nested > 0){
                result += cal(index, nested - 1, data);
                result %= MOD;
            }
        }
       // System.out.println(result + " " + index + " " + nested);
        return dp[index][nested]= result;

    }
}
// Problem: 909_C. Python Indentation
// Time complexity: quadratic
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class _909C {

    private static final int MOD = 1000000007;

    private static void solve(Scanner scan, PrintWriter pw) {
        int n = scan.nextInt();
        scan.nextLine();

        // dp[i][j] is the number ways the ith statement is indented j times
        int[][] dp = new int[n][n];
        int[][] dpSums = new int[n][n];

        dp[0][0] = 1;

        for(int i = 0; i < n; i++) {
            dpSums[0][i] = 1;
        }

        boolean lastIsSimple = scan.nextLine().equals("s");

        for(int i = 1; i < n; i++) {

            if(lastIsSimple) {
                dp[i][0] = dpSums[i-1][n-1];
                dpSums[i][0] = dp[i][0];

                for(int j = 1; j < n; j++) {
                    dp[i][j] = (dpSums[i-1][n-1] - dpSums[i-1][j-1] + MOD) % MOD;
                    dpSums[i][j] = (dp[i][j] + dpSums[i][j-1]) % MOD;
                }
            }
            else {
                dp[i][0] = 0;
                dpSums[i][0] = 0;

                for(int j = 1; j < n; j++) {
                    dp[i][j] = dp[i-1][j-1];
                    dpSums[i][j] = (dp[i][j] + dpSums[i][j-1]) % MOD;
                }

            }

            lastIsSimple = scan.nextLine().equals("s");
        }

        System.out.println(dpSums[n-1][n-1]);
    }

    public static void main(String[] args) {
        Scanner scan = new Scanner(new BufferedInputStream(System.in, 1024 * 64));
        PrintWriter pw = new PrintWriter(new BufferedOutputStream(System.out, 1024 * 64));
        solve(scan, pw);
        pw.flush();
    }

}
// Problem: 909_C. Python Indentation
// Time complexity: quadratic
import java.util.Scanner;

public class C {

    private static final int MOD = (int) 1e9 + 7;

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();

        int[][] DP = new int[n][n + 1];
        DP[0][0] = 1;

        for (int i = 0; i < n - 1; i++) {
            if (in.next().charAt(0) == 'f') {
                for (int j = 1; j < n; j++)
                    DP[i+1][j] = DP[i][j-1];
            } else {
                for (int j = n - 1; j >= 0; j--)
                    DP[i+1][j] = (DP[i][j] + DP[i+1][j+1]) % MOD;
            }
        }

        int answer = 0;
        for (int i = 0; i < n; i++)
            answer = (answer + DP[n-1][i]) % MOD;
        System.out.println(answer);
    }

}
// Problem: 909_C. Python Indentation
// Time complexity: quadratic


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class C {

	//dp[firstInLoop][index][indentLevel]
	private static int[][][] dp;
	private static boolean[] wasLoop;
	private static int MOD=1000000007;
	private static int n;
	
	public static void solve(FastScanner fs) {	
		n=fs.nextInt();
		dp=new int[2][n][n];
		for (int i=0; i<dp.length; i++)
			for (int j=0; j<dp[i].length; j++)
				Arrays.fill(dp[i][j], -1);
		wasLoop=new boolean[n];
		for (int i=0; i<n; i++)
			wasLoop[i]=fs.next().equals("f");
		
		int ans=go(0, 0, 0);
		System.out.println(ans);
	}
	
	private static int go(int firstInLoop, int index, int indentLevel) {
		if (index>=n)//base case
			return 1;
		if (dp[firstInLoop][index][indentLevel]!=-1)
			return dp[firstInLoop][index][indentLevel];
		
		//if I am forced, just do it
		if (firstInLoop==1)
			return dp[firstInLoop][index][indentLevel]=go(wasLoop[index]?1:0, index+1, indentLevel+(wasLoop[index]?1:0));
		
		//if I am on the end level, I don't have a choice
		if (indentLevel==0) {
			return dp[firstInLoop][index][indentLevel]=go(wasLoop[index]?1:0, index+1, wasLoop[index]?1:0);
		}
		else {
			//otherwise, add all the possibilities
			int total=0;
			total+=go(firstInLoop, index, indentLevel-1);
			total+=go(wasLoop[index]?1:0, index+1, indentLevel+(wasLoop[index]?1:0));
			total%=MOD;
			return dp[firstInLoop][index][indentLevel]=total;
		}
	}

	
	
	
	
	public static void main(String[] args) throws NumberFormatException, IOException {
		FastScanner scanner = new FastScanner(System.in);
		solve(scanner);
	}
	

	private static class FastScanner {
		BufferedReader br;
		StringTokenizer st;
		public FastScanner(InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));
		}
		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		int nextInt() {
			return Integer.parseInt(next());
		}
		long nextLong() {
			return Long.parseLong(next());
		}
		double nextDouble() {
			return Double.parseDouble(next());
		}
		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++)
				a[i]=nextInt();
			return a;
		}
	}
}
// Problem: 911_D. Inversion Counting
// Time complexity: quadratic
import java.util.*;
public class A {
	public static void main(String args[]) {
		Scanner sc = new Scanner (System.in);
		int n = sc.nextInt();
		int a[] = new int[n+1];
		for(int i=1 ; i<=n ; i++) a[i] = sc.nextInt();
		int cnt = 0;
		for(int i=1 ; i<=n ; i++) {
			for(int j=i-1 ; j>=1 ; j--) {
				if(a[i]<a[j])
					++cnt;
			}
		}
		//System.out.println(cnt);
		int q = sc.nextInt();
		cnt = cnt % 2; 
		while(q-->0) {
			int x = sc.nextInt();
			int y = sc.nextInt();
			int r = y-x+1;
			long ok = (r*(r-1))/2;
			if(ok%2==0) {
				
			}
			else {
				cnt ^= 1 ; 
			}
			System.out.println(cnt==0?"even":"odd");
		}
	}
}
// Problem: 911_D. Inversion Counting
// Time complexity: quadratic
import java.io.*;
import java.util.*;

public class Problem911D {
        public static void main(String args[]) throws IOException {
                Scanner sc = new Scanner(System.in);
                int n = sc.nextInt(), i, j;
                int ar[] = new int[n];
                int inv = 0;
                
                for(i = 0; i < n; i++) {
                        ar[i] = sc.nextInt();
                }
                
                for(i = 0; i < n; i++) {
                        for(j = 0; j < n; j++) {
                                if(i > j && ar[i] < ar[j]) {
                                        inv = (inv + 1) % 2;
                                }
                        }
                }
                
                int q = sc.nextInt();
                
                for(i = 0; i < q; i++) {
                        int l = sc.nextInt();
                        int r = sc.nextInt();
                        
                        int c = ( ((r-l)*(r-l+1))/2 ) % 2;
                        inv = (inv + c) % 2;
                        
                        if(inv == 0)
                                System.out.println("even");
                        else
                                System.out.println("odd");

                }
        }
}
// Problem: 911_D. Inversion Counting
// Time complexity: quadratic
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Liavontsi Brechka
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static
    @SuppressWarnings("Duplicates")
    class TaskD {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = in.nextIntArray(n);
            int m = in.nextInt();

            int count = 0;
            for (int i = 0; i < n; i++) {
                for (int j = i + 1; j < n; j++) {
                    if (a[i] > a[j]) count++;
                }
            }

            StringBuilder res = new StringBuilder();

            int l, r, temp, c1, c2;
            while (m-- > 0) {
                l = in.nextInt() - 1;
                r = in.nextInt() - 1;

                c1 = c2 = 0;
                for (int i = 0; i < (r - l + 1) / 2; i++) {
                    if (a[l + i] > a[r - i]) c1++;
                    else c2++;

                    temp = a[l + i];
                    a[l + i] = a[r - i];
                    a[r - i] = temp;
                }

                count = count + c1 - c2;
                res.append(Math.abs(count) % 2 == 1 ? "odd" : "even").append('\n');
            }

            out.print(res);
        }

    }

    static class InputReader {
        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        public int[] nextIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; ++i) {
                array[i] = nextInt();
            }
            return array;
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(readLine());
            }
            return tokenizer.nextToken();
        }

        public String readLine() {
            String line;
            try {
                line = reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return line;
        }

    }
}
// Problem: 911_D. Inversion Counting
// Time complexity: quadratic
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class InversionCounting {
public static void main(String[] args) throws IOException{
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	br.readLine();
	int[] a = Arrays.stream(br.readLine().split(" ")).mapToInt(x->Integer.parseInt(x)).toArray();
	boolean evenInv = true;
	for (int i = 0; i < a.length; i++) {
		for (int j = 0; j < a.length-1; j++) {
			if(a[j]>a[j+1]) {
				int temp = a[j];
				a[j] = a[j+1];
				a[j+1] = temp;
				evenInv =!evenInv;
			}
		}
	}
	int q = Integer.parseInt(br.readLine());
	for (int i = 0; i < q; i++) {
		int[] sw = Arrays.stream(br.readLine().split(" ")).mapToInt(x->Integer.parseInt(x)).toArray();
		int len = sw[1]-sw[0];
		if((len)*(len+1)%4 != 0) {
			evenInv = !evenInv;
		}
		if(evenInv) {
			System.out.println("even");
		}else {
			System.out.println("odd");
		}
	}
	
}
}
// Problem: 911_D. Inversion Counting
// Time complexity: quadratic
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Liavontsi Brechka
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static
    @SuppressWarnings("Duplicates")
    class TaskD {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = in.nextIntArray(n);
            int m = in.nextInt();

            int count = 0;
            for (int i = 0; i < n; i++) {
                for (int j = i + 1; j < n; j++) {
                    if (a[i] > a[j]) count = (count + 1) % 2;
                }
            }

            StringBuilder res = new StringBuilder();

            int l, r, temp;
            while (m-- > 0) {
                l = in.nextInt() - 1;
                r = in.nextInt() - 1;

                for (int i = 0; i < (r - l + 1) / 2; i++) {
                    temp = a[l + i];
                    a[l + i] = a[r - i];
                    a[r - i] = temp;
                }

                count = count ^ (((r - l + 1) * (r - l) / 2) % 2);
                res.append(count == 1 ? "odd" : "even").append('\n');
            }

            out.print(res);
        }

    }

    static class InputReader {
        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        public int[] nextIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; ++i) {
                array[i] = nextInt();
            }
            return array;
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(readLine());
            }
            return tokenizer.nextToken();
        }

        public String readLine() {
            String line;
            try {
                line = reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return line;
        }

    }
}
// Problem: 911_D. Inversion Counting
// Time complexity: quadratic
import java.util.*;
public class maestro{
    public static long inversions(long[] arr) {
        long x = 0;
        int n = arr.length;
        for (int i = n - 2; i >= 0; i--) {
            for (int j = i + 1; j < n; j++) {
                if (arr[i] > arr[j]) {
                    x++;
                    //temp++;
                }
                //if (temp%2==0) inv_a[i][j]=0;
                //else inv_a[i][j]=1;
            }
        }
        return x;
    }
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        long[] arr = new long[n];
        for (int i=0;i<n;i++) arr[i] = sc.nextLong();
        long m = sc.nextLong();
        long x = inversions(arr)%2;
        for (int i=0;i<m;i++){
            int l = sc.nextInt()-1;
            int r = sc.nextInt()-1;
            if ((r-l+1)%4>1) x=(x+1)%2;
            if (x==1) System.out.println("odd");
            else System.out.println("even");
        }
        /*int inv=0;
        int temp=0;
        long[][] inv_a = new long[n][n];
        for (int i=0;i<n;i++){
            for (int j=0;j<n;j++){
                inv_a[i][j]=-1;
            }
        }
        for (int i=n-2;i>=0;i--){
            for (int j=i+1;j<n;j++){
                if (arr[i]<arr[j]){
                    inv++;
                    temp++;
                }
                if (temp%2==0) inv_a[i][j]=0;
                else inv_a[i][j]=1;
            }
            temp=0;
        }
        if (inv%2==0) inv=0;
        else inv=1;
        for (int i=0;i<m;i++){
            int l = sc.nextInt()-1;
            int r = sc.nextInt()-1;
            long[][] exp = new long[r-l+1][r-l+1];
            for (int k=0;k<exp.length;k++){
                for (int h=0;h<exp.length;h++){
                    exp[k][h]=-1;
                }
            }
            for (int j=l;j<=r;j++){

            }
        }*/
    }
}
// Problem: 911_D. Inversion Counting
// Time complexity: quadratic
//package educational35;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class ProblemD {
	
	public static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
	public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	public static StringTokenizer tok = null;

	public static void main(String args[]) throws IOException {
		tok = new StringTokenizer(in.readLine());
		int n = Integer.parseInt(tok.nextToken());
		
		int tab[] = new int[n]; 
		tok = new StringTokenizer(in.readLine());
		for (int i=0; i<n; i++)
			tab[i] = Integer.parseInt(tok.nextToken());
		
		int inversions = countInversions(tab);
		boolean isOdd = inversions % 2 == 1;
		
		tok = new StringTokenizer(in.readLine());
		int k = Integer.parseInt(tok.nextToken());
		
		int start, end, len;
		
		for (int i=0; i<k; i++)	{
			tok = new StringTokenizer(in.readLine());
			start = Integer.parseInt(tok.nextToken());
			end = Integer.parseInt(tok.nextToken());
			
			len = (end - start + 1) % 4;
			if (len == 2 || len ==3)
				isOdd = !isOdd;
			
			out.println(isOdd ? "odd" : "even");
		}
		
		out.close();
		
	}
	
	private static int countInversions(int tab[]) {
		int n = tab.length;
		int auxTab[] = new int[n+1];
		return _countInversions(tab, 0, n, auxTab);
	};
	
	private static int _countInversions(int tab[], int start, int end, int auxTab[]) {
		//indices from start to end; but values from start+1 to end+1 !!
		if (start+1 >= end)
			return 0;
		
		int mid = (start + end) / 2;
		int lowerFound = 0;
		int higherFound = 0;
		
		int count = 0;
		
		for (int i=start; i<end; i++){
			if (tab[i] < mid+1){
				count += higherFound;
				auxTab[start+lowerFound] = tab[i];
				lowerFound++;
			} else {
				auxTab[mid + higherFound] = tab[i];
				higherFound++;
			}
		}
		
		for (int i=start; i<end; i++)
			tab[i] = auxTab[i];
		
		count += _countInversions(tab, start, mid, auxTab);
		count += _countInversions(tab, mid, end, auxTab);
		
		return count;
	}
	
	
	
}
// Problem: 911_D. Inversion Counting
// Time complexity: quadratic
import java.io.PrintWriter;
import java.util.Scanner;

public class D {
	
	public void solve(Scanner in, PrintWriter out) {
		int n = in.nextInt();
		int[] a = new int[n + 1];
		for(int i = 1; i <= n; ++i) a[i] = in.nextInt();
		
		int[] rangeInv = new int[n + 1];

		BIT bit = new BIT(n + 1);
		for(int i = 1; i <= n; ++i) {
			int cur = a[i];
			int inv = (int) bit.sum(cur, n);
			rangeInv[i] = rangeInv[i - 1] + inv;
			bit.add(cur, 1);
		}
		
		int m = in.nextInt();
		int curTotal = rangeInv[n];
		
		for(int qq = 0; qq < m; ++qq) {
			int l = in.nextInt();
			int r = in.nextInt();
			
			int N = r - l + 1;
			int total = N * (N - 1) / 2;
			
			int cur = rangeInv[r] - rangeInv[l - 1];
			
			int newInv = total - cur;
			
			curTotal -= cur;
			curTotal += newInv;
			
			if(curTotal % 2 == 0) {
				out.println("even");
			} else {
				out.println("odd");
			}
		}
		
	}

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		new D().solve(in, out);

		in.close();
		out.close();
	}
	
	class BIT {

	    long[] tree;
	    int n;

	    public BIT(int n) {
	        this.n = n;
	        tree = new long[n + 1];
	    }

	    public void add(int i, long val)
	    {
	        while(i <= n)
	        {
	            tree[i] += val;
	            i += i & -i;
	        }
	    }

	    public long sum(int to)
	    {
	        long res = 0;
	        for(int i = to; i >= 1; i -= (i & -i))
	        {
	            res += tree[i];
	        }
	        return res;
	    }

	    public long sum(int from, int to) {
	        return sum(to) - sum(from - 1);
	    }
	}
}