Milly loves chocolates very much. She is at the land of chocolates. This land has N rooms such that there are some chocolates of different brands in every room. It is possible that there can be multiple chocolates of same brand in a particular room. Now she is in a dilemma that whether she can eat at least K distinct branded chocolates at least once. Your task is to print the minimum number of rooms she must visit to eat at least those K distinct brands at least once.

Note : Once she enters a particular room, she will eat all of the chocolates available in that room.

Input

First line of the input will contain a integer T (number of test cases). 
Then for every test case there will be one line containing the values of  N (denoting the number of rooms) and K separated by a space.
Now each of the next N lines will first have a value P then P space separated strings denoting the names of the brands. 

 Output

For every test case, print the required answer and if it is not possible to eat those K distinct chocolates then print -1.

Constraints

1 ≤ T ≤ 3 
1 ≤ N  ≤ 16
 1 ≤ K ≤ 40 
 1 ≤ P ≤ 10
 1 ≤ Length of the strings ≤ 10

SAMPLE INPUT
1
3 2
1 KITKAT
2 FIVESTAR KITKAT
2 KITKAT PERK

SAMPLE OUTPUT
1
NOT_FOUND = 100000000


def isOKay(ChocolateMap):
    Cnt = 0
    for k, v in ChocolateMap.iteritems():
        if v >= 1:
            Cnt += 1
    return Cnt


def Rec(N, K, Chocolates, Position, ChocolateMap):
    if (Position == N):
        if isOKay(ChocolateMap) >= K:
            return 0
        return NOT_FOUND

    for item in Chocolates[Position]:
        ChocolateMap[item] += 1
    Ans = Rec(N, K, Chocolates, Position + 1, ChocolateMap) + 1
    for item in Chocolates[Position]:
        ChocolateMap[item] -= 1
    Ans = min(Ans, Rec(N, K, Chocolates, Position + 1, ChocolateMap))
    return Ans


T = int(raw_input())
for cs in range(T):
    N, K = map(int, raw_input().split())
    Chocolates = []
    ChocolateMap = {}
    for i in range(N):
        Temp = map(str, raw_input().split())
        Chocolates.append([item for item in Temp[1:]])
        for item in Chocolates[i]:
            ChocolateMap[item] = 0
    Result = Rec(N, K, Chocolates, 0, ChocolateMap)
    if Result == NOT_FOUND:
        Result = -1
    print Result