subset-xor-4

Given a set S. Generate T, a set that contains all subsets of S minus the null set  and calculate A, XOR sum of the set T.  
S={1,2,3}
T={{1},{2},{3},{1,2},{1,3},{2,3} ,{1,2,3}}
A=XORiana of T .
XORiana of a set is defined as XOR of all the elements it contains.

Constraints:
1 ≤ T ≤ 100
1 ≤ N ≤ 100
0 ≤ Array[i] ≤ 200

SAMPLE INPUT
2
2 
3 3
3 
1 2 3

SAMPLE OUTPUT
0
0

Explanation

*Test Case 1: *
All subsets will be {3},{3},{3,3}
XOR of of all elements : {3} XOR{3} XOR {3 XOR 3} is zero .

*Test Case 2: * 
All subsets will be   {1} ,{2} ,{3} ,{1,2} ,{1,3} ,{2,3} ,{1,2,3} 
XOR of all elements :  {1}  XOR {2} XOR {3} XOR {1 XOR 2} XOR {1 XOR 3}  XOR {2 XOR 3}  XOR {1 XOR 2 XOR 3}  is zero.

Source: hackerearth | Difficulty: EASY
Tags: Bit manipulation

Fundamentals


Solutions:
'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
T = int(input())
for t in range(T):
	n = int(input())
	arr = input()
	print(0 if n!=1 else int(arr))
	


t=int(eval(input()));
for i in range(0,t):
	n=int(eval(input()));
	d=input("");
	d=d.split(" ");
	Y=0;
	if(len(d)==1):
		Y=int(d[0]);
	
	print(Y)        
   



'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
t = eval(input())
for i in range(t) :
	n = eval(input())
	inputVals = input()
	inputVl = inputVals.split()
	if n < 2 :
		print(int(inputVl[0]))
	else :
		val = 0
		print(val)
		


def main():
	t=eval(input())
	for i in range(t):
		n=eval(input())
		a=list(map(int,input().split()))
		if n<2:
			print(a[0])
		else:
			print(0)
main()


import operator
def subsets(s):
	r=[0]
	for e in s:
		r+=[x^e for x in r]
	return r

def main():
	t=eval(input())
	for i in range(t):
		n=eval(input())
		a=list(map(int,input().split()))
		ans=0
		if n<2:
			ans=a[0]
		elif n==2:
			ans=a[0]^a[1]
		else:
			ans=0
		print(ans)
main()


for i in range(int(input())):
	n=int(input())
	s=input()
	s=s.split()
	if len(s)==1:
		print(s[0])
	else:
		print(0)


for case in range(eval(input())):
	n = eval(input())
	list = list(map(int, input().split()))
	if n > 1:
		print(0)
	else:
		print(list[0])


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	print(0 if n > 1 else a[0])	


def main():
	t=eval(input())
	for i in range(t):
		n=eval(input())
		a=list(map(int,input().split()))
		ans=0
		if n<2:
			ans=a[0]
		elif n==2:
			ans=a[0]^a[1]
		else:
			ans=0
		print(ans)
main()


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
t= eval(input())

for _ in range(t):
	n = eval(input())
	t = list(map(int,input().split()))
	if n ==1:
		print(t[0])
	else:
		print('0')


for i in range(eval(input())):
	j=eval(input())
	k=input()
	if j==1:
		print(k)
	else:
		print(0)


import itertools
import sys
from itertools import chain, combinations

N = int(sys.stdin.readline())

a = 0
def XORREC(t):
	b = 0
	for i in t:
		b = b ^ int(i)
	return b

for i in range(0,N):
	noe = int(sys.stdin.readline())
	j = list(sys.stdin.readline().strip().split(' '))
	a = 0
	if(noe == 1):
		print((j[0]))
	else:
		print((0))
	#for z in chain.from_iterable(combinations(j, r) for r in range(len(j)+1)):
	#	if( not z):
#			pass
#		else:
#			if a == 0:
#				a = XORREC(z)
#			else:
#				a = a ^ XORREC(z)
	#print(a)


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
T=int(input())
for i in range(0,T):
	N=int(input())
	res=0
	arr=list(map(int,input().split()))
	if(N==1):
		print(arr[0])
	else:
		print("0")


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
T=int(input())
for i in range(0,T):
	N=int(input())
	res=0
	arr=list(map(int,input().split()))
	if(N==1):
		print(arr[0])
	else:
		print("0")


t=eval(input())
for _ in range(t):
	n=eval(input())
	a=[int(x) for x in input().split()]
	if n==1:
		print(a[0])
	else:
		print(0)


x=int(input())
for i in range(0,x):
	y=int(input())
	f=list(map(int,input().split()))
	if(y>1):
		print("0")
	else:
		print(f[0])


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
testcases=int(input())
for i in range(testcases):
	number=int(input())
	test=input()
	count =len(test)
	if number==1:
		print(int(test))
	else:
		print(0)


T=eval(input())
for _ in range(T):
	n=eval(input())
	x=list(map(int,input().split()))
	print(x[0] if n==1 else 0)