Coffee Central#2285

Coffee Central

15 seconds
256 megabytes
Easy

Is it just a fad, or is it here to stay? You're not sure, but the steadily increasing number of coffee shops opening in your hometown has certainly become quite a draw. Apparently, people have become so addicted to coffee that apartments close to many coffee shops will fetch higher rents.

This has come to the attention of a local real-estate company. They are interested in identifying the most valuable locations in the city in terms of proximity to many coffee shops. You have been given a map of the city with all coffee shops marked. Assuming that the average person is willing to walk only a fixed number of blocks for their morning coffee, you need to find the location from which one can reach the largest number of coffee shops.

As you probably know, your hometown is built on a rectangular grid, with blocks aligned with the north-south and east-west axes. Since walking is only allowed along the streets, the distance between intersections and is |a - c| + |b - d|.

Input

The input contains several test cases. Each test describes a city. The first line of each test case contains four integers , , and . These specify the grid dimensions dx \times dy (1 \le dx, dy \le 1000), the number of coffee shops (0 \le n \le 5 \cdot 10^5) and the number of queries (1 \le q \le 20). Each of the next lines contains two integers x_i and y_i (1 \le x_i \le dx, 1 \le y_i \le dy), specifying the coordinates of the -th coffee shop. There is at most one coffee shop per intersection. Each of the next lines contains a single integer (0 \le m \le 10^6), the maximal distance a person is willing to walk for coffee.

The last test case is followed by a line containing four zeros.

Output

For each test case, print its number. For each query, print a line with the maximum number of coffee shops reachable within distance and the coordinates of the optimal location. For example, in the sample, coffee shops are within distance of the optimal location , shops are within distance of the optimal location , and shops are within distance of the optimal location . If there are multiple optimal locations, choose the southernmost one (smallest positive -coordinate). If there is still a tie, choose the westernmost one (smallest positive -coordinate).

Follow the format of the sample output.

Examples

Example 1

Loading
Loading