Welcome to ZOJ
Information
Select Problem
Runs
Ranklist
ZOJ Problem Set - 3338
Map

Time Limit: 1 Second      Memory Limit: 32768 KB

Roba found a strange theorem on BBS one day. As he was very curious with the theorem, he published the theorem to his blog at once. If a map is placed in the corresponding city, there is exactly one point coincident, the theorem says. Now he wants you to write a program to find out that point.

Input

The first line of the input is an integer indicating the number of test cases.

Each test case contains 5 lines. The first line contains two floating number W, H, indicating the width and the height of the city. (1.00 <= W, H <= 100.00) Here we assume that the city is a rectangle with coordinates at (0, 0), (W, 0), (W, H) and (0, H). The next four lines contain the corresponding coordinates of the map in the order above. The map is guaranteed to be a rectangle and complete inside the city. And each side of the map is strictly shorter than that of the city. The distance from any point of the map to the edge of the city is at least 0.01.

Output

Output the coordinates of the coincident point accurate to 0.01 in one line, separated by a single space.

Sample Input

2
4.0 4.0
1.0 1.0
3.0 1.0
3.0 3.0
1.0 3.0
6.0 8.0
2.0 3.0
4.0 3.0
4.0 5.0
2.0 5.0

Sample Output

2.00 2.00
3.00 4.00


Author: GUAN, Yao
Source: ZOJ Monthly, May 2010
Submit    Status