In the Olympics, appearances do matter!
A long jumper's trajectory gives the height at horizontal position x as y=max(0,p(x)), where p(x)=a(x−h)2+k is a quadratic describing a downward-opening parabola whose vertex (h,k) lies in the upper half-plane. That is, a<0 and k>0.
Thanks to rigorous training, each jumper always jumps with the same trajectory, and because of corporate sponsorship and branding requirements no two jumpers share the same trajectory.
Adoring fans who want to preserve the moment occasionally sample their favorite athlete's coordinates at various times and write them down, such as (0,0), (1,3), (2,4), (3,3), (4,0), (7,0). Given two sample sets, determine whether they were taken from the same athlete.
The input contains multiple test cases, each separated by a blank line. Each test case consists of three lines.
The first line contains two integers n1 and n2 (1≤n1,n2≤10) separated by a space, giving the number of sample points in the first and second sample sets, respectively.
The second and third lines contain the sample points of each set in the format x1 y1 x2 y2 ⋯ xn yn. Every coordinate is an integer, x1<x2<⋯<xn, and for each i, 0≤xi≤100000 and 0≤yi≤1000. Be careful that your calculations have sufficient precision for all input within these bounds.
Input is terminated by a single line containing 0 0; do not process that line.
For each test case, output a single line: same if the two sample sets are definitely from the same athlete, different if they are definitely from different athletes, and unsure if there is not enough information to tell.