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 gcd(a,x):
    if a > x:
        if a%x == 0:
            return x
        return gcd(x,a%x)
    else:
        if x%a == 0:
            return a
        return gcd(x%a,a)

def coprime(a,x):
    temp = gcd(a,x)
    #print "emp: {}".format(temp)
    if temp == 1:
        #print a
        return a
    return -1

if __name__ == "__main__":
    q = input()
    while q > 0:
        q = q-1
        try:
            result_ans = []
            n,x = raw_input().split()
            n = int(n)
            x = int(x)
            lis = raw_input().split()

            for i in xrange(len(lis)):
                lis[i] = int(lis[i])

            for j in xrange(len(lis)):
                result_1 = coprime(lis[j],x)
                if result_1 is not -1:
                    result_ans.append(result_1)

            #print t_ans
            if len(result_ans):
                for i in xrange(len(result_ans)):
                    result_ans[i] = str(result_ans[i])
                p = " ".join(result_ans)
                print p
            else:
                print -1

        except:
            pass