Rain again#8588

Rain again

1 secondo
128 megabyte
Facile

Elly is really proud of her terrace, because she has an by pot of beautiful flowers there. The girl and Stancho often sit and watch the flowers while talking. Whenever it starts raining, though, Elly stops listening to the boy and concentrates on where the water drops fall. If at any time during the rain at least one rain drop has fallen strictly inside each by rectangle within the pot, the girl considers the flowers well-watered and again starts paying attention to Stancho. Please note that the rectangle should have sides parallel to the sides of the flower pot. More precisely, the side of the rectangle with length should be parallel to the abscissa (-coordinate) and the one with length should be parallel to the ordinate (-coordinate). Now Stancho is interested when the girl will start again to listen to him. Help him by finding when this will happen.

It is assumed that the upper surface of the flower pot (a square with dimensions L \times L) is situated in a coordinate system, and its corners are with coordinates , , and . During the rain in the flower pot fall rain drops in total.

Write a program, which defines, whether the flowers will be watered and, if yes, after which drop will this happen.

Input

On the first line will be given the integers (1 \leq n \leq 10^5), (1 \leq L \leq 10^9), and (1 \leq w, h \leq L) - the number of rain drops that have fallen inside the pot during the rain, the length of the sides of the pot, and the lengths of the rectangles Elly is interested in. Each of the following lines will contain two integers x_i and y_i (0 \leq x_i, y_i \leq L), giving the coordinates of the rain drops, in the order they have fallen.

Output

On a single line print one integer - the number of rain drops that fall before Elly considers her flowers well-watered. If even after all drops there is a rectangle with the described properties that has no water drop strictly inside it, print instead.

Esempi

Esempio 1

Loading
Loading

Nota

After the -th drop falls in no more sub-rectangles of size by remain without a drop strictly inside them.