Problem: You are given n sets of integers. The i-th set contains k_i integers.

Two sets are called similar if they share at least two common elements, i. e. there exist two integers x and y such that x ≠ y, and they both belong to each of the two sets.

Your task is to find two similar sets among the given ones, or report that there is no such pair of sets.

Input

The first line contains a single integer t (1 ≤ t ≤ 50000) — the number of test cases. Then t test cases follow.

The first line of each test case contains a single integer n (2 ≤ n ≤ 10^5) the number of given sets. The following n lines describe the sets. The i-th line starts with an integer k_i (2 ≤ k_i ≤ 10^5) — the number of integers in the i-th set. Then k_i integers a_{i,1}, a_{i,2}, ..., a_{i,k_i} (1 ≤ a_{i,j} ≤ 10^9) follow — the elements of the i-th set. It is guaranteed that all elements in each set are different.

The total number of elements in all sets in all test cases is not greater than 2⋅ 10^5.

Output

For each test case, print the answer on a single line. 

If there is no pair of similar sets, print -1. 

Otherwise, print two different integers — the indices of the similar sets. The sets are numbered from 1 to n in the order they are given in the input. If there are multiple answers, print any of them.

Example

Input


3
4
2 1 10
3 1 3 5
5 5 4 3 2 1
3 10 20 30
3
4 1 2 3 4
4 2 3 4 5
4 3 4 5 6
2
3 1 3 5
3 4 3 2


Output


2 3 
1 2 
-1

Solution (in PYTHON):

Solution:
import sys
from collections import defaultdict
range = xrange
input = raw_input

inp = [int(x) for x in sys.stdin.read().split()]; ii = 0
out = []

t = inp[ii]; ii += 1
for _ in range(t):
    n = inp[ii]; ii += 1
    As = []
    for _ in range(n):
        k = inp[ii]; ii += 1
        As.append(inp[ii: ii + k]); ii += k

    counter = defaultdict(int)
    for A in As:
        for a in A:
            counter[a] += 1
    
    m_small = 0
    m_big = 0
    BIG_LIM = 200
    mapper = {}

    Bs = []
    for A in As:
        tmp = []
        Bs.append(tmp)
        for a in A:
            if a not in mapper:
                if counter[a] <= 1:
                    pass
                elif counter[a] >= BIG_LIM:
                    mapper[a] = m_big
                    tmp.append(m_big)
                    m_big += 1
                else:
                    mapper[a] = ~m_small
                    tmp.append(~m_small)
                    m_small += 1
            else:
                tmp.append(mapper[a])
    m = m_small + m_big
    
    blocks = (m_big + 30) // 31
    bitsets = [[0] * blocks for _ in range(n)]
    for i in range(n):
        for b in Bs[i]:
            if b >= 0:
                bitsets[i][b // 31] |= 1 << (b % 31)
    
    where = [[] for _ in range(m)]
    for i in range(n):
        for b in Bs[i]:
            where[b].append(i)

    def find_common():
        for elem in range(-m_small, m_big):
            bitset = [0] * blocks
            for i in where[elem]:
                bitsetsi = bitsets[i]
                for j in range(blocks):
                    if bitset[j] & bitsetsi[j]:
                        return elem, j * 31 + (bitset[j] & bitsetsi[j]).bit_length() - 1
                    bitset[j] |= bitsetsi[j]
                if 0 <= elem:
                    bitset[elem // 31] ^= 1 << (elem % 31)
        return -1,-1
    
    def find_uncommon():
        mark = [-1] * n
        for i in range(n):
            for elem in Bs[i]:
                if elem < 0:
                    for j in where[elem]:
                        if mark[j] == i and j != i:
                            return i,j
                        mark[j] = i
        return -1,-1


    a,b = find_common()
    if b >= 0:
        for i1 in range(n):
            if a in Bs[i1] and b in Bs[i1]:
                break
        for i2 in range(i1 + 1, n):
            if a in Bs[i2] and b in Bs[i2]:
                break
    else:
        i1,i2 = find_uncommon()

    if i1 >= i2:
        i1,i2 = i2,i1

    if i1 >= 0:
        out.append('%d %d' % (i1 + 1, i2 + 1))
    else:
        out.append('-1')

print '\n'.join(out)