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