You are given an array A containing N integers and Q queries. Each query is denoted by two integers L,R. The answer to a query is AL+(AL⊕AL+1)+⋯+(AL⊕AL+1⊕⋯⊕AR), where ⊕ denotes the bitwise XOR operator.
Input format
Output format
For each test query, print the answer in a separate line.
Constraints
1≤N,Q≤2⋅1050≤Ai<2301≤L≤R≤N
The answer to the first query is =A3+(A3⊕A4)=2+(2⊕6)=2+4=6.
The answer to the second query is =A1+(A1⊕A2)+(A1⊕A2⊕A3)=1+(1⊕7)+(1⊕7⊕2)=1+6+4=11.