Socks#2326

Socks

1 second
64 megabytes
Very easy

A table of length is given. There are socks placed on the table so that none of them extend beyond its edges.

A clever boy named Vasya wants to measure the thickness of the sock covering at different points on the table.

Input

The first line contains three integers l, n, m (1 \le l, n \le 10^4, 1 \le m \le 10^5).

Then pairs of integers left, right (1 \le left \le right \le l) are given — the coordinates of the left and right ends of each sock.

After that, integers between and are given — the coordinates of the points where Vasya wants to measure the thickness of the covering.

Output

Print integers — the thickness of the sock covering at each of the specified points.

Examples

Example 1

Loading
Loading