Endless Turning

Simulate a scooter rider who turns right at every intersection, and report her road after N turns or when she exits the city.

Medium7GeometrySimulationGraphNo attempts yetTime limit2sMemory limit512 MB

Problem

Last week your little sister got a scooter for her birthday. Since then she goes out for a ride several times a day without telling anyone. She leaves the house and rides along the pavement beside the road. She knows that she must not cross a road, and she is not yet skilful enough to turn her scooter around on the pavement. So every time she reaches an intersection, she turns right.

You are tired of being sent after her. You know how she rides, so you decide to write a program that tells you which road she is on.

The city has RR roads. Each road has a name and is an infinite line in the plane. No point lies on three or more roads, so exactly two roads meet at every intersection.

Your parents' house (X,Y)(X, Y) lies on a road that is not parallel to the yy-axis, on the south side of that road. Your sister therefore sets off east, in the direction of increasing xx. She repeats the following rules.

  • While she has turned right fewer than NN times, she keeps riding along her current road in her current direction.
  • If there is an intersection ahead of her in that direction, she rides to the nearest one and turns right onto the other road that meets her there. This counts as one right turn.
  • If there is no intersection ahead of her, she rides out of the city and never turns again.

Turning right means her direction of travel bends clockwise. Of the two directions of the other road at the intersection, her new direction is the one reached by rotating her old direction clockwise by less than 180180 degrees.

Find the name of the road your sister is riding on after NN right turns. If she rode out of the city before completing NN turns, find the name of the road she was riding on when she left.

Input

The first line contains the number of roads RR, the number of right turns NN, and the coordinates XX and YY of your parents' house. (1R1001 \le R \le 100, 0N10100 \le N \le 10^{10}, X107|X| \le 10^7, Y107|Y| \le 10^7)

Each of the next RR lines describes one road. A line contains a name SS of at most 2020 characters that has no spaces and uses only letters and digits, followed by four integers X1X_1, Y1Y_1, X2X_2, Y2Y_2. Road SS is the infinite line through the points (X1,Y1)(X_1, Y_1) and (X2,Y2)(X_2, Y_2). (X1,Y1,X2,Y2107|X_1|, |Y_1|, |X_2|, |Y_2| \le 10^7, (X1,Y1)(X2,Y2)(X_1, Y_1) \ne (X_2, Y_2))

No point lies on three or more roads. Your parents' house (X,Y)(X, Y) lies on exactly one road, that road is not parallel to the yy-axis, and the house is not at an intersection. Both coordinates of every intersection have absolute value at most 10710^7, and two different intersections on the same road are at least 10410^{-4} apart.

Output

Print the name of the road your sister is riding on, on one line.

Hint

The picture shows the three roads of the first example. Your sister starts on Homedrive heading east and turns right onto Narrowlane, Broadway, Homedrive, Narrowlane in that order, so after four turns she is on Narrowlane.