import numpy as np

def f1(M, c):
    # M: a 2-D numpy array
    # c: float
    A = np.zeros_like(M)
    for i in range(M.shape[0]):
        for j in range(M.shape[1]):
            A[i,j] = M[i,j]*c
    return A

def f2(U, V):
    # U and V: 1-D numpy arrays of equal size
    d = 0
    for i in range(len(U)):
        d += U[i]*V[i]
    return d

def f3(M):
    # M: a 2-D numpy array
    t = np.ndarray(M.shape[::-1])
    for i in range(M.shape[1]):
        for j in range(M.shape[0]):
            t[i,j] = M[j,i]
    return t

def f4(x, y, dx, dy, k, R):
    # x, y, dx, dy: 1-D numpy arrays of all equal size
    # k, R: float

    neighbors = [(x[i]-x[k])**2 + (y[i]-y[k])**2 <= R**2
                 for i in range(len(x))]
    sx = sy = 0
    for i in range(len(neighbors)):
        # True is equal to 1 and False is equal to 0
        sx += neighbors[i] * dx[i]  
        sy += neighbors[i] * dy[i]
    t = np.arctan2(sy, sx)
    return np.cos(t), np.sin(t)

#----- DON'T modify any of the following lines -----
for k in range(int(input())):
    exec(input().strip())