The Olympic Games have just started and Federico is eager to watch the marathon race.

There will be n athletes, numbered from 1 to n, competing in the marathon, and all of them have taken part in 5 important marathons, numbered from 1 to 5, in the past. For each 1≤ i≤ n and 1≤ j≤ 5, Federico remembers that athlete i ranked r_{i,j}-th in marathon j (e.g., r_{2,4}=3 means that athlete 2 was third in marathon 4).

Federico considers athlete x superior to athlete y if athlete x ranked better than athlete y in at least 3 past marathons, i.e., r_{x,j}<r_{y,j} for at least 3 distinct values of j.

Federico believes that an athlete is likely to get the gold medal at the Olympics if he is superior to all other athletes.

Find any athlete who is likely to get the gold medal (that is, an athlete who is superior to all other athletes), or determine that there is no such athlete.

Input

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

The first line of each test case contains a single integer n (1≤ n≤ 50 000) — the number of athletes.

Then n lines follow, each describing the ranking positions of one athlete.

The i-th of these lines contains the 5 integers r_{i,1},\,r_{i,2},\,r_{i,3},\,r_{i,4},  r_{i,5} (1≤ r_{i,j}≤ 50 000) — the ranking positions of athlete i in the past 5 marathons. It is guaranteed that, in each of the 5 past marathons, the n athletes have distinct ranking positions, i.e., for each 1≤ j≤ 5, the n values r_{1,j},  r_{2, j},  ...,  r_{n, j} are distinct.

It is guaranteed that the sum of n over all test cases does not exceed 50 000.

Output

For each test case, print a single integer — the number of an athlete who is likely to get the gold medal (that is, an athlete who is superior to all other athletes). If there are no such athletes, print -1. If there is more than such one athlete, print any of them.

Example

Input


4
1
50000 1 50000 50000 50000
3
10 10 20 30 30
20 20 30 10 10
30 30 10 20 20
3
1 1 1 1 1
2 2 2 2 2
3 3 3 3 3
6
9 5 3 7 1
7 4 1 6 8
5 6 7 3 2
6 7 8 8 6
4 2 2 4 5
8 3 6 9 4


Output


1
-1
1
5

Note

Explanation of the first test case: There is only one athlete, therefore he is superior to everyone else (since there is no one else), and thus he is likely to get the gold medal.

Explanation of the second test case: There are n=3 athletes. 

  * Athlete 1 is superior to athlete 2. Indeed athlete 1 ranks better than athlete 2 in the marathons 1, 2 and 3. 
  * Athlete 2 is superior to athlete 3. Indeed athlete 2 ranks better than athlete 3 in the marathons 1, 2, 4 and 5. 
  * Athlete 3 is superior to athlete 1. Indeed athlete 3 ranks better than athlete 1 in the marathons 3, 4 and 5. 



Explanation of the third test case: There are n=3 athletes. 

  * Athlete 1 is superior to athletes 2 and 3. Since he is superior to all other athletes, he is likely to get the gold medal. 
  * Athlete 2 is superior to athlete 3. 
  * Athlete 3 is not superior to any other athlete. 



Explanation of the fourth test case: There are n=6 athletes. 

  * Athlete 1 is superior to athletes 3, 4, 6. 
  * Athlete 2 is superior to athletes 1, 4, 6. 
  * Athlete 3 is superior to athletes 2, 4, 6. 
  * Athlete 4 is not superior to any other athlete. 
  * Athlete 5 is superior to athletes 1, 2, 3, 4, 6. Since he is superior to all other athletes, he is likely to get the gold medal. 
  * Athlete 6 is only superior to athlete 4. 
//package codeforces;

import java.util.Scanner;
import java.text.DecimalFormat;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.PriorityQueue;
import java.util.TreeMap;
import java.util.TreeSet;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Stack;

public class q_1 {
	// Integer.bitCount(i); count no of 1 bit in a given number
	static Scanner scn = new Scanner(System.in);
	static boolean board[][];

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

	static FastReader s = new FastReader();

	public static void main(String[] args) {
		/* TODO Auto-generated method stub */
		// System.out.format("%.10f", ans);char c = scn.next().charAt(0); (read text
		// from right to left)
		int t = scn.nextInt();
		while (t-- > 0) {
			int n=scn.nextInt(),c1=0,c2=0;
			int arr[][]=new int[n][5],ans[]=new int[n];
			for(int i=0;i<n;i++)
			{
				for(int j=0;j<5;j++)
					arr[i][j]=scn.nextInt();
			}
			if(n==1)
				System.out.println("1");
			else
			{
				int best=0;
				for(int i=1;i<n;i++)
				{
					if(!sup(arr, best, i))
					{
						best=i;
					}
				}
				//System.out.println(best);
				boolean bl=true;
				for(int i=0;i<n;i++) {
					if(i==best) {
						continue;
					}
					if(!sup(arr,best,i)) {
						bl = false;
					}
				}
				if(bl)
					System.out.println(best+1);
				else
					System.out.println("-1");
					
			}
			
		}

	}
	static boolean sup(int[][] arr,int x,int y) {
		int count=0;
		for(int i=0;i<5;i++) {
			if(arr[x][i]<arr[y][i]) {
				count++;
			}
		}
		return count>=3;
	}

	public static long ncr(long n, long r) {
		if (n < r)
			return 0;
		else if (r == 1)
			return n;
		else if (r == 2)
			return (n * (n - 1)) / 2;
		else
			return (n * (n - 1) * (n - 2)) / 6;
	}

	public static double roundDown5(double d) {
		return ((long) (d * 1e6)) / 1e6;
		// Long typecast will remove the decimals
	}

	public static long gcd(long a, long b) {
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}

}

class poin implements Comparable<poin> {

	int fi, se;

	poin(int a, int b) {
		this.fi = a;
		this.se = b;
	}

	@Override
	public int compareTo(poin o) {
		// TODO Auto-generated method stub

		if (fi > o.fi)
			return 1;
		else if (fi == o.fi) {
			if (se < o.se)
				return -1;
			else
				return 1;
		} else
			return -1;
	}
}

class pair {
	int x;
	int y;

	pair(int a, int b) {
		this.x = a;
		this.y = b;

	}

	public int hashCode() {
		return x * 31 + y * 31;
	}

	public boolean equals(Object other) {
		if (this == other)
			return true;

		if (other instanceof pair) {
			pair pt = (pair) other;

			return pt.x == this.x && pt.y == this.y;
		} else
			return false;
	}
}

class sorting implements Comparator<pair> {

	@Override
	public int compare(pair o1, pair o2) {
		// TODO Auto-generated method stub
		int a = o1.x - o2.x, b = o1.y - o2.y;
		if (b > 0)
			return -1;
		else if (b == 0) {
			if (a > 0)
				return 1;
			else
				return -1;
		} else
			return 1;
	}

}
