Bobo has a sequence

. Initially,

holds.
One day, Bobo comes up with infinite operations. The operations are described by m pairs of integers
%2C%20(a_2%2C%20b_2)%2C%20%5Cdots%2C%20(a_m%2C%20b_m))
. The i-th operation is to reverse the elements between the
%20%5Cbmod%20m%20%2B%201%7D)
-th and the
%20%5Cbmod%20m%20%2B%201%7D)
-th. Note that a sequence

becomes

after reserving the elements between the x-th and the y-th.
Bobo also has q questions

. The i-th question is to ask the number of i satisfying

if he executes only the first

operations. Answer the questions!
输入描述:
The input consists of several test cases and is terminated by end-of-file.
The first line of each test case contains three integers n, m and q.
The i-th of the following m lines contains 2 integers
and
.
The i-th of the last q lines contains an integer
.
输出描述:
For each test case, print q integers which denote the answers.
示例1
输入
复制
5 1 2
2 4
1
2
5 2 1
1 3
3 5
1000000000
备注:
For the first sample, the sequence becomes 1, 4, 3, 2, 5 after the first operation, and becomes 1, 2, 3, 4, 5 after the second one. Thus, the answer are 3, 5 respectively.
* 
* 
* 
* 
* 
* The number of test cases does not exceed 5.