#ECSER. Progression
Progression
Let S be an infinite sequence of integers:
S0 = a;
S1 = b;
Si = |Si-2 - Si-1| for all i ≥ 2.
You have two integers a and b. You must answer some queries about the n-th element in the sequence
Input
The first line contains a and b (0 ≤ a, b ≤ 1018).
The second line contains a integer q (1 ≤ q ≤ 100000).
The third contains q integers qi.
Output
For each qi you must print a line with the qi-th element of S.
Example
Input: 21 12 5 0 1 2 3 4</p>Output: 21 12 9 3 6
Note: the values of qi are in the range of 64 bits.