n,a,b=map(int,input().split()) f=0 c=27720 for i in range(n+1): k=int(input()) s=(b^i-a^i)*k//(i+1)*c f=f+s print(f//c)