aaryan-subsequences-and-great-xor
Source: hackerearth
Difficulty: EASY

Aaryan went to school like any usual day, The teacher asked his crush the following question. 
Given an array of numbers, First she had to compute the XOR of all the subsequences that can be formed.
Suppose each subsequence had their following XOR value that came out after computing -> {P[0], P[1], P[2], and so on upto P[2^n-1] subsequences in an array of n numbers}

Now, the resultant answer is computed by taking bitwise inclusive OR of all P[i]'s 

Since, Aaryan wants to impress his crush, He wants to compute the answer for this problem but since he is not so good at it, he turned to you for help.

Input:
First line will consist of number N.
Then in the next line, there will be N numbers, ith number in the line is denoted by A[i]

Output:
Output the required value as answer.

Constraints:
1 ≤ N ≤ 10^6
0 ≤ A[i] ≤ 10^9

SAMPLE INPUT
4
8 9 9 8

SAMPLE OUTPUT
9


N = eval(input())
A = list(map(int,input().split()))
ans = 0
for i in A:
	ans = ans | i
print(ans)
	


def main():
	tot=int(input())
	seq=list(map(int,input().split(" ")))
	ii=0
	ans=0
	while(ii<tot):
		ans|=seq[ii]
		ii+=1
	print(ans)
main()


n = int(input())
k = input()
a = k.split(" ")

lol = int(a[0])

for i in range(1, n):
	lol = lol|int(a[i])

print(lol)


n = int(input())
inp = str(input()).split()
inp = [int(inp[i]) for i in range(n)]
curr = inp[0]
oor = 0
for i in range(1,n):
	xx = curr ^ inp[i]
	curr = xx
	oor = xx | oor
print(oor)


from sys import stdin
stdin.readline()
a=list(map(int, stdin.readline().split()))
b=a[0]
for i in a[1:]:
	b|=i
print(b)


import sys
from functools import reduce
n=int(sys.stdin.readline().strip())
a=sys.stdin.readline().strip().split(' ')
print((reduce(lambda x,y: int(x)|int(y),a)))


m=int(input())
ans=0
n=input()
a=n.split(" ")
while(m):
	m=m-1
	ans=ans|int(a[m])
print(ans|int(a[0]))


i=1
flag=0
ans=0
q=input("")
q=int(q)
x=input("")
x=list(map(int,x.split()))
ans=int(ans)
for y in range(0,q-1):
	if(flag==0):
		ans=x[0]|x[i]
		i+=1
		flag=1
	else:
		ans=ans|x[i]
		i+=1

print(ans)
	


n= eval(input())
a=list(map(int,input().split()))
final=0
for i in range(len(a)):
	final|=a[i]
print(final)



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

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
n=eval(input())
p=input()
x=[int(y) for y in p.split(" ")]
z=len(x)-1
a=0
while z>=0:
	a=a|x[z]
	z=z-1
print(a)
	


input()
x = 0
for i in map(int, input().split()):
	x |= i
print(x)	


n=eval(input())
a=list(map(int,input().split()))
x=0
for y in a: x=x| y
print(x)