Vedant has a hidden array of N elements. Given the [bitwise AND] of all elements of the array, determine whether the total sum of the elements is odd, even or cannot be determined.

------ Input Format ------ 

- The first line of each input contains T - the number of test cases. The test cases then follow.
- The only line of each test case contains two space-separated integers N and A - the number of elements in the hidden array and the bitwise AND of all the elements in the hidden array.

------ Output Format ------ 

For each test case, output Even if the sum of all elements in the hidden array is even, Odd if the sum of all elements in the hidden array is odd, or Impossible if the parity cannot be determined.

Note: You may print each character of the string in uppercase or lowercase (for example, the strings eVen, EvEn, even and EVEN will all be treated as identical).

------ Constraints ------ 

$1 ≤ T ≤ 10000$
$1 ≤ N ≤ 10^{9}$
$0 ≤ A ≤ 10^{9}$

----- Sample Input 1 ------ 
3
1 11
1 2
74120341 829182732
----- Sample Output 1 ------ 
Odd
Even
Impossible

Source: codechef | Difficulty: MEDIUM
Tags: Bit manipulation

Mathematics


Solutions:
for _ in range(int(input())):
	(n, a) = map(int, input().split())
	if a % 2:
		if n % 2:
			print('Odd')
		else:
			print('Even')
	elif n == 1:
		print('Even')
	else:
		print('Impossible')


for tc in range(int(input())):
	(n, k) = map(int, input().split())
	if k % 2 == 0:
		if n == 1:
			ans = 'Even'
		else:
			ans = 'Impossible'
	elif n % 2 == 0:
		ans = 'Even'
	else:
		ans = 'Odd'
	print(ans)


for z in range(int(input())):
	(a, b) = map(int, input().split())
	if a % 2 == 0 and b & 1 == 1 or (a == 1 and b & 1 == 0):
		print('Even')
	elif a % 2 != 0 and b & 1 == 1:
		print('Odd')
	else:
		print('Impossible')


for _ in range(int(input())):
	(n, a) = [int(i) for i in input().split()]
	if n % 2 == 0 and a & 1 == 1 or (n == 1 and a & 1 == 0):
		print('Even')
	elif n % 2 != 0 and a & 1 == 1:
		print('Odd')
	else:
		print('Impossible')


for i in range(int(input())):
	(n, m) = map(int, input().split())
	if n == 1:
		if m % 2 == 0:
			print('Even')
		else:
			print('Odd')
	elif n % 2 != 0:
		if m % 2 != 0:
			print('Odd')
		else:
			print('Impossible')
	elif n % 2 == 0:
		if m % 2 != 0:
			print('Even')
		else:
			print('Impossible')


t = input()
for c in range(0, int(t)):
	(n, a) = map(int, input().split())
	if n == 1:
		if a % 2 == 1:
			print('Odd')
		elif a % 2 == 0:
			print('Even')
	elif n % 2 == 0:
		if a % 2 == 1:
			print('Even')
		else:
			print('Impossible')
	elif a % 2 == 1:
		print('Odd')
	else:
		print('Impossible')


def solve(n, a):
	if n == 1:
		if a & 1:
			return 'Odd'
		else:
			return 'Even'
	val = a & 1
	if val == 1:
		return 'Even' if n % 2 == 0 else 'Odd'
	else:
		return 'Impossible'
for _ in range(int(input())):
	(n, a) = map(int, input().split())
	print(solve(n, a))


num = int(input())
for num1 in range(num):
	(a, b) = map(int, input().split())
	if a == 1:
		if b % 2 == 0:
			print('Even')
		else:
			print('Odd')
	elif a % 2 == 0:
		if b % 2 == 0:
			print('Impossible')
		else:
			print('Even')
	elif b % 2 == 0:
		print('Impossible')
	else:
		print('Odd')


t = int(input())
while t:
	(n, a) = map(int, input().split())
	if a % 2 == 1:
		if n % 2 == 0:
			print('Even')
		else:
			print('Odd')
	elif a % 2 == 0:
		if n == 1:
			print('Even ')
		else:
			print('Impossible')
	t -= 1


for i in range(int(input())):
	(N, A) = map(int, input().split())
	BinS = bin(A)[2:]
	if BinS[len(BinS) - 1] == '1':
		if N % 2 == 0:
			print('Even')
		else:
			print('Odd')
	elif N == 1:
		if A % 2 == 0:
			print('Even')
		else:
			print('Odd')
	else:
		print('Impossible')


for _ in range(int(input())):
	d = {1: 'Odd', 0: 'Even'}
	(n, a) = map(int, input().split())
	if a % 2 != 0 or n <= 2:
		if n <= 2:
			print(d[a % 2])
		else:
			print(d[n % 2])
	else:
		print('Impossible')


t = int(input())
for _ in range(t):
	(n, a) = list(map(int, input().split()))
	if n == 1:
		print('Odd' if a % 2 else 'Even')
	else:
		x = a % 10
		if x == 0 or x % 2 == 0:
			print('Impossible')
		else:
			print('Odd' if n % 2 else 'Even')


import sys
import math
import bisect
import numpy as np
from sys import stdin, stdout
from itertools import accumulate, chain, combinations, groupby, permutations, product
from collections import deque, Counter
from bisect import bisect_left, bisect_right
from math import gcd, sqrt, sin, cos, tan, degrees, radians
from fractions import Fraction
from decimal import Decimal
import sys
MOD = 10 ** 9 + 7
INF = 10 ** 20
sys.setrecursionlimit(100000000)
inp = lambda : int(input())
strng = lambda : input().strip()
jn = lambda x, l: x.join(map(str, l))
strl = lambda : list(input().strip())
mul = lambda : map(int, input().strip().split())
mulf = lambda : map(float, input().strip().split())
seq = lambda : list(map(int, input().strip().split()))
ceil = lambda x: int(x) if x == int(x) else int(x) + 1
ceildiv = lambda x, d: x // d if x % d == 0 else x // d + 1
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))

def solve():
	(a, b) = map(int, input().split())
	if a == 1:
		if b % 2 == 1:
			print('Odd')
		else:
			print('Even')
	elif a % 2 == 1:
		if b % 2 == 0:
			print('Impossible')
		else:
			print('Odd')
	elif b % 2 == 0:
		print('Impossible')
	else:
		print('Even')
for _ in range(int(input())):
	solve()


t = int(input())
for _ in range(t):
	(n, A) = map(int, input().split())
	if n == 1:
		if A & 1:
			print('Odd')
		else:
			print('Even')
		continue
	if A & 1 == 0:
		print('Impossible')
		continue
	if n & 1:
		print('Odd')
	else:
		print('Even')


for a0 in range(int(input())):
	(n, k) = list(map(int, input().split()))
	if n == 1:
		if k % 2 == 0:
			print('Even')
		else:
			print('Odd')
	elif k % 2 == 1:
		if n % 2 == 0:
			print('Even')
		else:
			print('Odd')
	else:
		print('Impossible')


import sys
for _ in range(int(sys.stdin.readline())):
	(n, a) = map(int, sys.stdin.readline().split())
	if n == 1:
		if a % 2 == 0:
			print('Even')
		else:
			print('Odd')
	elif a % 2 != 0:
		if n % 2 == 0:
			print('Even')
		else:
			print('Odd')
	else:
		print('Impossible')


num = int(input())

def answer(integer):
	if integer % 2 == 0:
		print('Even')
	else:
		print('Odd')
while num:
	num -= 1
	a1 = input().split()
	(n, a) = (int(a1[0]), int(a1[1]))
	if n == 1:
		answer(a)
		continue
	if a % 2 == 0:
		print('Impossible')
	else:
		answer(n)


t = int(input())
for i in range(t):
	(n, a) = [int(x) for x in input().split()]
	if a & 1 == 1:
		if n & 1 == 1:
			result = 'Odd'
		else:
			result = 'Even'
	elif n == 1:
		result = 'Even'
	else:
		result = 'Impossible'
	print(result)


for u in range(int(input())):
	(n, l) = map(int, input().split())
	if l % 2 == 1:
		if n % 2 == 1:
			print('Odd')
		else:
			print('Even')
	elif n == 1:
		print('Even')
	else:
		print('Impossible')


from math import sqrt, log, ceil
import sys
from random import randint as r

def solve():
	(n, a) = map(int, input().split())
	if n == 1:
		if a & 1:
			print('Odd')
		else:
			print('Even')
		return
	if a & 1:
		if n & 1:
			print('Odd')
		else:
			print('Even')
		return
	print('Impossible')
for _ in range(int(input())):
	solve()


T = int(input())
for i in range(T):
	(N, A) = input().split()
	N = eval(N)
	A = eval(A)
	if A % 2 != 0:
		if N % 2 == 0:
			print('Even')
		else:
			print('Odd')
	elif N == 1:
		print('Even')
	else:
		print('Impossible')


import sys
input = sys.stdin.readline
for t in range(int(input())):
	(n, a) = map(int, input().split())
	if n == 1:
		if a & 1 == 1:
			print('Odd')
		else:
			print('Even')
		continue
	if a & 1 == 1:
		if n & 1 == 1:
			print('Odd')
		else:
			print('Even')
	else:
		print('Impossible')


def solution():
	pass
for _ in range(int(input())):
	(n, a) = map(int, input().split())
	if a % 2 != 0:
		if n % 2 == 0:
			print('Even')
		else:
			print('Odd')
	elif n == 1:
		print('Even')
	else:
		print('Impossible')