#jag2018summerday2g. [jag2018summer_day2_g]Construct One Point
[jag2018summer_day2_g]Construct One Point
Problem Statement
You have triangles, numbered through .
The coordinates of the vertices of the -th triangle are , and in counterclockwise order. Here, , , , , and are all integers.
For each triangle, determine if there exists a grid point contained in its interior (excluding the boundary). If it exists, construct one such point.
Constraints
- All input values are integers.
- , and are in counterclockwise order.
- The areas of the triangles are not .
Input
Input is given from Standard Input in the following format:
Output
Output should contain lines.
In the -th line, if there is no grid point contained in the interior (excluding the boundary) of the -th triangle, print -1 -1
. If it exists, choose one such grid point, then print its -coordinate and -coordinate with a space in between.