Points In a planar square bounded whose opposite corners are (-20,000, -20,000) and (20,000, 20,000), consider a particular set of K (1 <= K <= 25,000) x,y points whose cartesian coordinates are both integers which we will call a `pattern'. In that same planar portion, consider as well a N (1 <= N <= 20) other sets of planar points, also with integer coordinates. We would like to know which of these sets is similar to the pattern, i.e., which of them can be transformed by rotations, translations, reflections and dilations (scaling) so that they are identical to the pattern. For instance: the set of points {(0,0), (2,0), (2,1)} is similar to the set {(6,1), (6,5), (4,5)}, it is however not similar to the set {(4,0),(6,0), (5,-1)}. Write a program which: * reads the description of the pattern and the family of the investigated sets of points, * determines which of the investigated sets of points are similar to the pattern, PROBLEM NAME: points INPUT FORMAT: * Line 1: A single integer: K * Lines 2..K+1: Line i describes point i of the pattern with two space-separated integers: x_i and y_i * Lines K+2.....: A single integer: N * Lines K+3.. and on: N descriptions of these sets follows. In the intuitive way, the description of each set begins with a line containing a single integer L, the number of points belonging to that particular set (1 <= L <= 25,000). Each of the subsequent L lines contains a pair of space separated integers, x_j,y_j. The points which belong to the same set are pairwise different. SAMPLE INPUT: 3 0 0 2 0 2 1 2 3 4 1 6 5 4 5 3 4 0 6 0 5 -1 OUTPUT FORMAT: * Lines 1..N: Line i contains the word TAK (YES in Polish), if the ith of the given sets of points is similar to the pattern or the word NIE (NO in Polish) if the set does not satisfy this condition. SAMPLE OUTPUT: TAK NIE