The Abominable Triangleman

You discovered the Magic Gold Triangle, which has the power to give fortune and wisdom to his owner, during an archaeological excavation in the tomb of the Egyptian emperor Triangles III. However, the Abominable Triangleman has followed your footsteps, stole the Triangle and hid it in the Plane World of the Visible Points. You know that, to disguise the Triangle, the Abominable Triangleman made some operations over it, but you don’t know the complete details. You know that the Magic Triangle may have been subject to an arbitrary rotation, may have been subject an arbitrary translation (both in the 2D plane) and may been subject to a reflection on a mirror, but its dimensions were kept unchanged. You also know that its sides became transparent and the only parts you can see from the Triangle are its vertices. However, there are so many points in the Plane World of the Visible Points! If you could guess which of them are the vertices of the Magic Gold Triangle, you could get it back... Figure 1: The Magic Gold Triangle before being stolen Figure 2: The Triangle is hidden in the Plane World of the Visible Points You know the coordinates of the vertices A, B and C of the Magic Gold Triangle when it was in your possession (example in Figure 1). You also know the coordinates of all the points currently in the Plane World of the Visible Points, which include the vertices of the stolen Triangle (example in figure 2). Your task is to make a program that may discover the Triangle, i. e., to find out which of the points in the Plane are the vertices of the hidden triangle. Input The input will contain several test cases, each of them as described below. Consecutive test cases are separated by a single blank line.

2/2 The input of your program will be a sequence of text lines. The first three lines will contain the original coordinates of the Triangle, before being stolen. The next line will contain an integer N in the interval [4..2000] representing the number of points in Plane World, and the next N lines the coordinates of those points. Coordinates will be represented by two integer numbers, the x-coordinate and the y-coordinate, separated by a space. Output For each test case, the output must follow the description below. The outputs of two consecutive cases will be separated by a blank line. The output will be a sequence of three lines with the coordinates of the points in the Plane World of the Visible Points corresponding to the vertices of the Magic Gold Triangle. The points will be presented sorted in ascending order by the x-coordinate; points with the same x-coordinate will be presented sorted in ascending order by the y-coordinate. The solution will always be unique. Sample Input 5 15 85 20 10 6 5 17 5 20 20 5 10 5 15 20 15 10 Sample Output 5 17 10 5 15 20