3544.IQ test

Time Limit: 1s Memory Limit: 256MB

Bob is preparing to pass IQ test. The most frequent task in this test is to find out which one of the given n numbers differs from the others. Bob observed that one number usually differs from the others in evenness. Help Bob - to check his answers, he needs a program that among the given n numbers finds one that is different in evenness.

Input Format(From the terminal/stdin)

The first line contains integer n (3 \le n \le 100) - amount of numbers in the task. The second line contains n space-separated natural numbers, not exceeding 100. It is guaranteed, that exactly one of these numbers differs from the others in evenness.

Output Format(To the terminal/stdout)

Output index of number that differs from the others in evenness. Numbers are numbered from 1 in the input order.

Sample Input 1

Copy
5
2 4 7 8 10
 \n
 · · · ·  \n

Sample Output 1

Copy
3
 \n

Sample Input 2

Copy
4
1 2 1 1
 \n
 · · · \n

Sample Output 2

Copy
2
 \n

Submit

请先 登录

© 2025 FAQs