Janmansh and Jay are playing a game. They start with a number X and they play a total of Y moves. Janmansh plays the first move of the game, after which both the players make moves alternatingly. 

In one move, a player can increment or decrement X by 1. 

If the final number after performing Y moves is even, then Janmansh wins otherwise, Jay wins. Determine the winner of the game if both the players play optimally.

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

- The first line will contain T - the number of test cases. Then the test cases follow.
- The first and only line of each test case contains two integers X, Y - the starting number and the total number of moves respectively.

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

For each test case, output the winning player (Janmansh or Jay).

You may print each character of Janmansh and Jay in uppercase or lowercase (for example, JAY, jaY, JAy will be considered identical).

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

$1 ≤T ≤100$
$1 ≤X, Y ≤100$

----- Sample Input 1 ------ 
2
2 2
4 3

----- Sample Output 1 ------ 
Janmansh
Jay

----- explanation 1 ------ 
Test case-1: The starting number is $X = 2$. One of the optimal games will be: 
- In the first move, Janmansh increases $X$ to $3$.
- In the second move, Jay increases $X$ to $4$.

Since the final number is even, Janmansh wins.

Test case-2: The starting number is $X = 4$. One of the optimal games will be: 
- In the first move, Janmansh decreases $X$ to $3$.
- In the second move, Jay decreases $X$ to $2$.
- In the third move, Janmansh increases $X$ to $3$.

Since the final number is odd, Jay wins.

Difficulty: EASY
Tags: Game theory

Starter code:

Solutions:
num = int(input())
for i in range(num):
	n1 = list(map(int, input().split(' ')))
	if sum(n1) % 2 == 0:
		print('Janmansh')
	else:
		print('Jay')


for _ in range(int(input())):
	(X, Y) = map(int, input().split())
	if (Y - X) % 2 == 0:
		print('Janmansh')
	else:
		print('Jay')


t = int(input())
for _ in range(t):
	(x, y) = map(int, input().split())
	games = lambda x, y: 'Jay' if abs(x - y) % 2 else 'Janmansh'
	print(games(x, y))


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if (b - a) % 2 == 0:
		print('Janmansh')
	else:
		print('Jay')


T = int(input())
for i in range(0, T):
	(x, y) = map(int, input().split())
	if (x + y) % 2 == 0:
		print('Janmansh')
	else:
		print('Jay')


t = int(input())
for i in range(0, t):
	(x, y) = list(map(int, input().split()))
	a = x + y
	b = x - y
	if a % 2 == 0 and b % 2 == 0:
		print('Janmansh')
	else:
		print('Jay')


for k in range(int(input())):
	(x, y) = map(int, input().split())
	if (y - x) % 2 == 0:
		print('Janmansh')
	else:
		print('Jay')


t = int(input())
for i in range(t):
	(m, n) = map(int, input().split())
	if (m + n) % 2 == 0:
		print('Janmansh')
	else:
		print('Jay')


for t in range(int(input())):
	(x1, y1) = map(int, input().split())
	for _ in range(y1):
		x1 += 1
	if x1 % 2 == 0:
		print('Janmansh')
	else:
		print('Jay')


k = int(input())
for _ in range(k):
	(start_num, num_moves) = map(int, input().split())
	if (start_num + num_moves) % 2 == 0:
		print('Janmansh')
	else:
		print('Jay')


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	if (a + b) % 2 == 0:
		print('Janmansh')
	else:
		print('Jay')


t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	n = 0
	while n < y:
		x = x + 1
		n = n + 1
	if x % 2 == 0:
		print('Janmansh')
	else:
		print('Jay')


t = int(input())
while t > 0:
	(x, y) = map(int, input().split())
	if (x + y) % 2 == 0:
		print('Janmansh')
	else:
		print('Jay')
	t -= 1


def aws(a, b):
	if (b - a) % 2 == 0:
		return 'Janmansh'
	else:
		return 'Jay'
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	v = aws(a, b)
	print(v)


t = int(input())
for i in range(t):
	(x, y) = map(int, input().split(' '))
	if x % 2 == 0 and y % 2 == 0:
		print('Janmansh')
	elif x % 2 != 0 and y % 2 != 0:
		print('Janmansh')
	else:
		print('Jay')


repeat = int(input())
for item in range(repeat):
	(start, total) = map(int, input().split())
	convert = start + total
	if convert % 2 == 0:
		print('Janmansh')
	if convert % 2 == 1:
		print('Jay')


import random
t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	while y != 0:
		r = random.choice([-1, 1])
		x = x - r
		y = y - 1
	if x % 2 == 0:
		print('Janmansh')
	else:
		print('Jay')


test_cases = int(input())
for c in range(test_cases):
	(x, y) = map(int, input().split(' '))
	if x % 2 == 0 and y % 2 == 0:
		print('Janmansh')
	elif x % 2 == 0 and y % 2 != 0:
		print('Jay')
	elif x % 2 != 0 and y % 2 == 0:
		print('Jay')
	elif x % 2 != 0 and y % 2 != 0:
		print('Janmansh')


for i in range(int(input())):
	(X, Y) = map(int, input().split())
	if X % 2 == 0:
		if Y % 2 == 0:
			print('Janmansh')
		else:
			print('Jay')
	elif Y % 2 == 0:
		print('Jay')
	else:
		print('Janmansh')


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	if a % 2 == 0 and b % 2 == 0 or (a % 2 != 0 and b % 2 != 0):
		print('Janmansh')
	elif a % 2 == 0 and b % 2 != 0 or (a % 2 != 0 and b % 2 == 0):
		print('Jay')