New Tree

Given point A and a new tree, find the smallest pair (B, C) so triangle ABC is counterclockwise, contains the new tree strictly, and contains no other old tree.

Medium6GeometryBrute forceNo attempts yetTime limit0.2sMemory limit1024 MB

Problem

A new tree was planted in the city park and the gardener wants to protect it. He picks three of the old trees, stretches a band around them, and the triangle enclosed by the band becomes the protected area. The new tree has to stand strictly inside that triangle, and no other tree may stand inside it or on its border.

The gardener has already picked one old tree, the one numbered AA. Find the other two.

The old trees are numbered 11 to NN. A pair of numbers (B,C)(B, C) is valid when all of the following hold:

  • BB and CC are different from each other and both are different from AA.
  • Walking the old trees AA, BB, CC in that order turns counterclockwise, so the three points are not collinear.
  • The new tree lies strictly inside triangle ABCABC, not on one of its sides.
  • No old tree other than AA, BB and CC lies inside triangle ABCABC or on one of its three sides.

Input

The first line has two integers NN and AA (3N3003 \le N \le 300, 1AN1 \le A \le N): the number of old trees and the number of the tree the gardener has already picked.

The second line has two integers xx and yy, the coordinates of the new tree.

Each of the next NN lines has two integers xx and yy (106x,y106-10^6 \le x, y \le 10^6), the coordinates of one old tree, given in order of the tree numbers. The N+1N + 1 points are pairwise distinct.

Output

Print BB and CC on one line, separated by a single space, so that AA, BB, CC in that order form a valid protected area.

If several pairs are valid, print the smallest one: compare BB first, and compare CC only when the two values of BB are equal. If no pair is valid, print 0 0.