Acrobat Reader

No attempts yetTime limit1sMemory limit128 MB

Problem

At an airport, biometric data is used to confirm that travelers are who they claim to be. A circus troupe touring abroad next month expects trouble at border control: when its acrobats face the camera, there is no telling which way their face will be oriented. You may assume that every acrobat looks straight into the camera, but the recorded face may be rotated by a multiple of 90 degrees. As with any passenger, the picture may also be translated and uniformly scaled (by the same factor along both axes).

You are given several pairs of biometric scans; each pair consists of one scan taken from the passport and one recorded live. For every acrobat, decide whether the two scans match.

Two scans match when one can be turned into the other using a rotation of $0°$, $90°$, $180°$, or $270°$, a translation, and a positive uniform scaling. Reflections (mirror images) are not allowed.

Input

The first line contains a single integer: the number of test cases.

Each test case has the following format.

  • One line with an integer $N$ ($1 \le N \le 10000$): the number of points in each of the acrobat's two scans.
  • $N$ lines, each with two integers $x_i$ and $y_i$ ($-10000 \le x_i, y_i \le 10000$): a point of the first scan (from the passport).
  • $N$ lines, each with two integers $x_i$ and $y_i$ ($-10000 \le x_i, y_i \le 10000$): a point of the second scan (recorded live).

The two integers on a line are separated by a single space. Within one scan no two points are identical, and the $N$ points are listed in arbitrary order.

Output

For each test case, print a single line: okay if the two scans match, or mismatch! if they do not.