codeparrot/codecomplex huggingface dataset:
// Problem: 25_A. IQ test
// Time complexity: linear
import java.io.*;

public class Main 
{
    public static void main(String []args)throws Exception
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        int n=0;
        n=Integer.parseInt(br.readLine());
        String inp="";
        inp=br.readLine();
        int no[]=new int[n];
        String tinp[]=inp.split(" ");
        for(int i=0;i<n;i++)
        {
            no[i]=Integer.parseInt(tinp[i]);
        }
        int eve=0,odd=0;
        for(int i=0;i<3;i++)
        {
            int rem=no[i]%2;
            if(rem==0)
                eve++;
            else
                odd++;
        }
               if(eve>1)
               {
                   for(int i=0;i<n;i++)
                   {
                       if(no[i]%2==1)
                       {
                           System.out.println(i+1);
                           break;
                       }
                   }
               }
               else
               {
                     for(int i=0;i<n;i++)
                      {
                          if(no[i]%2==0)
                          {
                           System.out.println(i+1);
                           break;
                          }
                      }
            
               }
                

}
}
// Problem: 25_A. IQ test
// Time complexity: linear
import java.util.Scanner;

public class Solution {

    public static void main(String args[]) {
    Scanner scanner = new Scanner(System.in);
    int n = scanner.nextInt();
    int[] arr = new int[n];
    for (int i = 0; i < n; ++i) {
        arr[i] = scanner.nextInt();
    }
    boolean isOdd = false;
    if ((arr[0] % 2 == 0 && arr[1] % 2 == 0) || (arr[0] % 2 == 0 && arr[2] % 2 == 0)
        || (arr[1] % 2 == 0 && arr[2] % 2 == 0)) {
        isOdd = true;
    }
    if (isOdd) {
        for (int i = 0; i < n; ++i) {
        if (arr[i] % 2 == 1) {
            System.out.println(i + 1);
            break;
        }
        }
    } else {
        for (int i = 0; i < n; ++i) {
        if (arr[i] % 2 == 0) {
            System.out.println(i + 1);
            break;
        }
        }
    }

    }

}
// Problem: 25_A. IQ test
// Time complexity: linear

import java.util.Scanner;


public class Contest25_A {
    
    static int[] parity;
    
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        
        int numberEntries = scan.nextInt();
        scan.nextLine();
        String[] numbers = scan.nextLine().split(" ");
        numbers = parity(numbers);
        int evenOdd = evenOdd(parity);
       
        for (int i = 0; i < parity.length; i++) {
            if (parity[i] == evenOdd) {
                System.out.println(i + 1);
                System.exit(0);
            }
        }
            
        
    }

    public static int evenOdd(int[] parity) {
        /*
         * Determines what I should be looking for
         * Return 0 if even
         * Return 1 if odd
         */
        int numberOnes = 0;
        int numberZeroes = 0;
        
        int one = parity[0];
        int two = parity[1];
        int three = parity[2];
        
        if (one == 1) 
            numberOnes++;
        else
            numberZeroes++;
        
        if (two == 1) 
            numberOnes++;
        else
            numberZeroes++;
        
        if (three == 1) 
            numberOnes++;
        else
            numberZeroes++;
        
        if (numberOnes >= 2)
            return 0;
        else
            return 1;
        
    }

    public static String[] parity(String[] numbers) {
        parity = new int[numbers.length];
        for (int i = 0; i < numbers.length; i++) {
            parity[i] = Integer.parseInt(numbers[i]) % 2;
            numbers[i] = Integer.toString(parity[i]);
        }
        return numbers;
    }
    
}
// Problem: 25_A. IQ test
// Time complexity: linear
import java.util.Scanner;

/**
 *
 * @author Ronak
 */
public class Main {

    /**
     * @param args the command line arguments
     */
   
    public static void main(String[] args) {
        // TODO code application logic here
        
        Scanner in=new Scanner(System.in);
         int n=in.nextInt();
         
        if(n>=3&&n<=100)
        {
        int num[]=new int[n];
        for(int i=0;i<n;i++)
        {
            num[i]=in.nextInt();
        }
        int even=0,odd=0,ceven=0,codd=0;
        for(int i=0;i<n;i++)
        {
            if(num[i]%2==0)
            {
                even++;
                ceven=i+1;
                
            }
            else
            {
                odd++;
                codd=i+1;
            }
        }
        if(odd==1)
        {
            System.out.println(""+codd);
        }
        else
        {
            System.out.println(""+ceven);
        }
        }
    }

}
// Problem: 25_A. IQ test
// Time complexity: linear
import java.util.Scanner;


public class A {

	public static void main(String[] args) {
		new A().run();
	}
	
	private void run() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int ce = 0;
		int co = 0;
		int le = 0;
		int lo = 0;
		for (int i = 0; i < n; i++) {
			int x = sc.nextInt();
			if (x % 2 == 0) {
				ce++;
				le = i + 1;
			} else {
				co++;
				lo = i + 1;
			}
		}
		System.out.println(ce == 1 ? le : lo);
	}

}
// Problem: 25_A. IQ test
// Time complexity: linear
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws Exception {
        //System.setIn(new FileInputStream("1"));
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);

        solve();

        in.close();
        out.close();
    }

    private static void solve() throws Exception {
        int n = nextInt();
        int co = 0, ce = 0;
        int[] v = new int[n];
        for (int i = 0; i < n; i++) {
            v[i] = nextInt();
        }
        for (int i = 0; i < n; i++) {
            if (v[i] % 2 == 0) {
                co++;
            } else {
                ce++;
            }
        }
        if (co == 1) {
            for (int i = 0; i < n; i++) {
                if (v[i] % 2 == 0) {
                    out.println(i + 1);
                    return;
                }
            }
        } else {
            for (int i = 0; i < n; i++) {
                if (v[i] % 2 != 0) {
                    out.println(i + 1);
                    return;
                }
            }
        }
    }

    private static BufferedReader in;
    private static PrintWriter out;
    private static StringTokenizer st;

    static String nextString() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(nextString());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(nextString());
    }
}
// Problem: 25_A. IQ test
// Time complexity: linear
import java.util.Scanner;


public class A_IQTest {

    static int n;

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        n = s.nextInt();
        
        int[] nums = new int[n];
        
        for (int i = 0; i < n; i++) {
            nums[i] = s.nextInt();
        }
        
        
        int ei = -1;
        int oi = -1;
        int ecnt = 0;
        int ocnt = 0;
        for (int i = 0; i < n; i++) {
            if(nums[i] % 2 == 0){
                ei = i;
                ecnt++;
            }else{
                oi = i;
                ocnt++;
            }
        }
        if(ecnt == 1){
            System.out.println(ei+1);
        }else{
            System.out.println(oi+1);
        }
    }

}
// Problem: 25_A. IQ test
// Time complexity: linear
import java.util.*;
public class Main { 
    public static void main(String[] args) {
        Main iq = new Main();
        Scanner sc = new Scanner(System.in);
        int n;
        n = sc.nextInt();
        int[] naturalNumbers = new int[n];
        for (int i = 0; i < naturalNumbers.length; i++) {
            naturalNumbers[i] = sc.nextInt();
        }
        System.out.println(iq.diffInEvenness(n, naturalNumbers));          
    }
    
    public int diffInEvenness(int n, int[] naturalNumbers) {       
        int even, odd, lastEvenIndex, lastOddIndex;
        even = odd = lastEvenIndex = lastOddIndex = 0;
        for (int i = 0; i < naturalNumbers.length; i++) {
            if((naturalNumbers[i] % 2) == 0) {
                even++;
                lastEvenIndex = i + 1;
            }
            else {
                odd++;
                lastOddIndex = i + 1;
            }
        }
        return (even > odd ? lastOddIndex : lastEvenIndex);     
    }

}
// Problem: 25_A. IQ test
// Time complexity: linear
import java.util.Scanner;

public class Iq {

    static void metod() throws Exception {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();

        int[] m = new int[n];

        for (int i = 0; i < n; i++)
            m[i] = in.nextInt();

        byte k = 0;
        if (m[0] % 2 == 0) {
            if (m[1] % 2 == 0) {
                k = 0;
            } else {
                if (m[2] % 2 == 0) {
                    System.out.println(2);
                    return;
                } else {
                    System.out.println(1);
                    return;
                }
            }
        } else {
            if (m[1] % 2 == 1) {
                k = 1;
            } else {
                if (m[2] % 2 == 0) {
                    System.out.println(1);
                    return;
                } else {
                    System.out.println(2);
                    return;
                }
            }
        }
        if (k == 0) {
            for (int i = 0; i < m.length; i++) {
                if (m[i] % 2 == 1) {
                    System.out.println(i + 1);
                    break;
                }
            }
        } else {
            for (int i = 0; i < m.length; i++) {
                if (m[i] % 2 == 0) {
                    System.out.println(i + 1);
                    break;
                }
            }
        }

    }

    public static void main(String args[]) throws Exception {
        Iq.metod();
    }

}
// Problem: 25_A. IQ test
// Time complexity: linear
import java.util.*;
public class IQ {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		ArrayList<Integer> e=new ArrayList<Integer>();
		ArrayList<Integer> o=new ArrayList<Integer>();
		int size=sc.nextInt();
		for(int w=0;w<size;w++)
		{
			int x=sc.nextInt();
			if(x%2==0)e.add(w+1);
			else o.add(w+1);
		}
		if(e.size()==1)System.out.println(e.get(0));
		else System.out.println(o.get(0));
		}
}
// Problem: 25_A. IQ test
// Time complexity: linear
import java.io.*;
import java.util.*;

public class Main implements Runnable {
	private BufferedReader in;
	private PrintWriter out;
	private StringTokenizer st;
	
	private void eat(String line)
	{
		st = new StringTokenizer(line);
	}
	
	private String next() throws IOException
	{
		while(!st.hasMoreTokens()) {
			String line = in.readLine();
			if(line == null)
				return null;
			eat(line);
		}
		return st.nextToken();
	}
	
	private int nextInt() throws IOException
	{
		return Integer.parseInt(next());
	}
	
	public void run()
	{
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(new OutputStreamWriter(System.out));
			eat("");
			
			go();
			
			out.close();
		} catch(Exception e) {
			e.printStackTrace();
			System.exit(-1);
		}
	}
	
	public static void main(String[] args)
	{
		new Thread(new Main()).start();
	}
	
	public void go() throws IOException
	{
		int n = nextInt();
		int[] v = new int[n], count = new int[2];
		for(int i = 0; i < n; ++i) {
			v[i] = nextInt();
			++count[v[i] % 2];
		}
		int residue = count[0] == 1 ? 0 : 1;
		for(int i = 0; i < n; ++i)
			if(v[i] % 2 == residue)
				out.println(i + 1);
	}
}
// Problem: 25_A. IQ test
// Time complexity: linear
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;


public class Test {

    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String s = in.readLine();
        String[] p = in.readLine().split(" ");
        List<Integer> a = new ArrayList<Integer>();
        for (String k : p) {
            a.add(Integer.parseInt(k));
        }
        int n = a.size();
        int c1 = 0;
        int c2 = 0;
        int c1p = 0;
        int c2p = 0;
        for (int i = 0; i < n; i++) {
            if (a.get(i) % 2 == 0) {
                c1++;
                c1p = i;
            } else {
                c2++;
                c2p = i;
            }
        }
        if (c1 < c2) {
            System.out.println(c1p + 1);
        }  else {
            System.out.println(c2p + 1);
        }
    }
    
}
// Problem: 25_A. IQ test
// Time complexity: linear
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;


public class Main {
    
    public static void main(String[] args) throws Exception {
        int i,j,k;
        int counter[] = new int[2];
        int a[] = new int[200];
        int needed;
        
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        int N = Integer.parseInt(br.readLine());
        StringTokenizer st = new StringTokenizer(br.readLine());
        
        for (i=1;i<=N;i++) {
            a[i] = Integer.parseInt(st.nextToken());
            counter[a[i]%2]++;
        }
        
        if (counter[0] == 1) {
            needed = 0;
        } else {
            needed = 1;
        }
        
        for (i=1;i<=N;i++) {
            if (a[i]%2 == needed) {
                System.out.println(i);
                return;
            }
        }
        
    }

}
// Problem: 25_A. IQ test
// Time complexity: linear
import java.util.*;

public class a {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int a[] = new int[n];
		for(int i=0;i<n;i++) a[i] = in.nextInt()%2;
		
		int z = 0;
		for(int i=0;i<n;i++) z+=(a[i] == 0)?1:0;
		if (z == 1) z = 0;
		else z = 1;
		
		for(int i=0;i<n;i++)
			if (a[i] == z){
				System.out.println(i+1);
				break;
			}
	}

}
// Problem: 25_A. IQ test
// Time complexity: linear
import java.util.Scanner;

public class IQ {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    int[] a = new int[n];
    for(int i = 0; i < n; i++)
      a[i] = scan.nextInt();
    for(int i = 0; i < n; i++) {
      boolean x = a[i] % 2 == 0;
      int c = 0;
      for(int j = 0; j < n; j++) {
        if(x != (a[j] % 2 == 0))
          c++;
      }
      if(c == n-1) {
        System.out.println(i+1);
        break;
      }
    }
  }
}
// Problem: 25_A. IQ test
// Time complexity: linear
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    
    public static void main(String[] args) throws NumberFormatException, IOException {
        Scanner sc = new Scanner(new InputStreamReader(System.in));
        int n = sc.nextInt(),even = 0,odd = 0,evI = 0,OdI = 0;      
        for (int i = 0; i < n; i++) {
            if(sc.nextInt()%2 == 1){
                odd++;
                OdI = i+1;
            }else{
                even++;
                evI = i+1; 
            }
        }
        if(even < odd)
            System.out.println(evI);
        else
            System.out.println(OdI);
        
    }
}
// Problem: 25_A. IQ test
// Time complexity: linear
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class A {

	/**
	 * @param args
	 * @throws IOException 
	 * @throws NumberFormatException 
	 */
	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int nums = Integer.parseInt(reader.readLine());
		
		String line = reader.readLine();
		int[] ar = new int[nums];
		String[] par = line.split(" ");
		
		for(int i=0; i<nums; i++){
			ar[i] = Integer.parseInt(par[i]);
		}
		A a = new A();
		
		System.out.print(a.getDif(ar));
	}
	
	private int getDif(int[] input){
		int odd = 0, even = 0, d = 0;
		int p = 0, q = 0;
		
		for(int i=0; i<input.length; i++){
			int t = input[i]%2;
			if(t==0){
				even++;
				p = i+1;
			}
			else{
				odd++;
				q = i+1;
			} 
			
			if(odd>0 && even>0 && (odd!=even)){
				if(even>odd)
					return q;
				else
					return p;
			}
			
		}
		
		return d;
	}

}
// Problem: 25_A. IQ test
// Time complexity: linear
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
public class A {
	public static void main(String[] args) throws IOException	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		StringTokenizer st = new StringTokenizer(br.readLine());
		int[] list = new int[n];
		for(int i = 0; i < list.length; i++)
			list[i] = Integer.parseInt(st.nextToken());
		int odd = 0;
		int even = 0;
		for(int x: list)
			if(x%2==1)	{
				odd++;
			}
			else	{
				even++;
			}
		for(int i = 1; i <= list.length; i++)	{
			if(list[i-1]%2==1 && odd == 1)	{
				System.out.println(i);
				return;
			}
			else if(list[i-1]%2 == 0 && even == 1){
				System.out.println(i);
				return;
			}
		}
	}

}
// Problem: 25_A. IQ test
// Time complexity: linear
/**
 * Created by IntelliJ IDEA.
 * User: dev_il
 * Date: 03.08.2010
 * Time: 0:59:04
 * To change this template use File | Settings | File Templates.
 */


import java.io.*;

import static java.lang.Math.*;

import java.util.*;

public class IQTest implements Runnable {
    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok;

    public static void main(String[] args) {
        new Thread(new IQTest()).start();
    }

    void solve() throws IOException {
        int n = nextInt();
        List<Integer> l1 = new ArrayList<Integer>();
        List<Integer> l2 = new ArrayList<Integer>();
        for (int i = 0; i < n; ++i) {
            int k = nextInt();
            if (k % 2 == 0) l1.add(i + 1);
            else l2.add(i + 1);
        }
        if (l1.size() == 1)
            out.println(l1.get(0));
        else out.println(l2.get(0));
    }

    public void run() {
        try {
            in = new BufferedReader(new InputStreamReader(System.in));
            // in = new BufferedReader(new FileReader(new File("input.txt")));
            out = new PrintWriter(System.out);
            // out = new PrintWriter(new File("output.txt"));
            solve();
            out.flush();
            out.close();
            in.close();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }

    String nextLine() throws IOException {
        tok = null;
        return in.readLine();
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    String nextToken() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

}
// Problem: 25_A. IQ test
// Time complexity: linear
import java.io.*;
import java.util.*;

import org.omg.PortableServer.ForwardRequestHelper;

public class A{     
        
        private BufferedReader in;  
        private StringTokenizer st;
        
        void solve() throws IOException{
            
            int n = nextInt();
            int i = 0;
            int[]nums = new int[n];
            int numeven = 0;
            int numodd = 0;
            while(n-->0){
                nums[i] = nextInt();
                if(nums[i]%2==0) numeven++;
                else numodd++;
                i++;
            }
            for (int j = 0; j < nums.length; j++) {
                if(numeven==1&&nums[j]%2==0){
                    System.out.println(j+1); break;
                }
                if(numodd==1&&nums[j]%2!=0){
                    System.out.println(j+1); break;
                }
            }
            
            
        }
            

        A() throws IOException {
            in = new BufferedReader(new InputStreamReader(System.in));          
            eat("");
            solve();            
        }

        private void eat(String str) {
            st = new StringTokenizer(str);
        }

        String next() throws IOException {
            while (!st.hasMoreTokens()) {
                String line = in.readLine();
                if (line == null) {
                    return null;
                }
                eat(line);
            }
            return st.nextToken();
        }

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

        long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        public static void main(String[] args) throws IOException {
            new A();
        }

        int gcd(int a,int b){
            if(b>a) return gcd(b,a);
            if(b==0) return a;
            return gcd(b,a%b);
        }
}