Problem: The evil mastermind, Moriarty, strikes again!  He sent Sherlock an image of a wall, with N integers painted on it. Sherlock is asked to solve the puzzle and find the next clue.
Sherlock knows that Moriarty is a deceitful person. All the numbers painted on the wall are not valid. Only the numbers that are Coprime with the integer X are valid, and the rest are a deceit. Help Sherlock find the valid integers from the given array A so that he can track down Moriarty.  

Input:
First line contains T. T test cases follow.
First line of each test case contains two space-separated integers N and X.
Second line of each test case contains N space-separated integers, forming the array A. 

Output:
Print the valid integers separated by spaces in the order that they appear in the list or "-1" (without the quotes) if there are no valid integers, in a new line for each test case.  

Constraints:
1 ≤ T ≤ 10
1 ≤ N ≤ 10^4
2 ≤ Ai, X ≤ 10^7

SAMPLE INPUT
1
5 4
2 5 8 3 13

SAMPLE OUTPUT
5 3 13

Solution (in PYTHON):

Solution:
def hcf(n1,n2):
    while n1*n2:
        if n1 > n2:
            n1 %= n2
        else:
            n2 %= n1
    return max( n1, n2 )

def coprime(n1,n2):
    return hcf(n1,n2) == 1

def checkCoPrimes(A,X):
    ls = filter(lambda y:coprime(y,X),A)
    if(ls == []):
        return '-1'
    else:
        return (reduce(lambda x,y: str(x) + ' ' + str(y),ls))

T = int(raw_input())

ls = []

for i in range(0,T):
    nx = raw_input()
    a = raw_input()
    ls.append([nx,a])

for i in ls:
    nx1 = map(int,i[0].split())
    N = nx1[0]
    X = nx1[1]
    A = map(int,i[1].split())
    result = checkCoPrimes(A,X)
    print result