There are $n$ districts in the town, the $i$-th district belongs to the $a_i$-th bandit gang. Initially, no districts are connected to each other.

You are the mayor of the city and want to build $n-1$ two-way roads to connect all districts (two districts can be connected directly or through other connected districts).

If two districts belonging to the same gang are connected directly with a road, this gang will revolt.

You don't want this so your task is to build $n-1$ two-way roads in such a way that all districts are reachable from each other (possibly, using intermediate districts) and each pair of directly connected districts belong to different gangs, or determine that it is impossible to build $n-1$ roads to satisfy all the conditions.

You have to answer $t$ independent test cases.


-----Input-----

The first line of the input contains one integer $t$ ($1 \le t \le 500$) — the number of test cases. Then $t$ test cases follow.

The first line of the test case contains one integer $n$ ($2 \le n \le 5000$) — the number of districts. The second line of the test case contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_i \le 10^9$), where $a_i$ is the gang the $i$-th district belongs to.

It is guaranteed that the sum of $n$ does not exceed $5000$ ($\sum n \le 5000$).


-----Output-----

For each test case, print:

  NO on the only line if it is impossible to connect all districts satisfying the conditions from the problem statement.  YES on the first line and $n-1$ roads on the next $n-1$ lines. Each road should be presented as a pair of integers $x_i$ and $y_i$ ($1 \le x_i, y_i \le n; x_i \ne y_i$), where $x_i$ and $y_i$ are two districts the $i$-th road connects. 

For each road $i$, the condition $a[x_i] \ne a[y_i]$ should be satisfied. Also, all districts should be reachable from each other (possibly, using intermediate districts).


-----Example-----
Input
4
5
1 2 2 1 3
3
1 1 1
4
1 1000 101 1000
4
1 2 3 4

Output
YES
1 3
3 5
5 4
1 2
NO
YES
1 2
2 3
3 4
YES
1 2
1 3
1 4

Difficulty: EASY

Solutions:
t = int(input())
for z in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	if len(set(arr)) == 1:
		print('NO')
	else:
		print('YES')
		rep = []
		for i in range(1, n):
			if arr[0] == arr[i]:
				rep.append(i)
			else:
				print('1', i + 1)
				k = i
		for num in rep:
			print(k + 1, num + 1)


from math import *
import sys
from sys import stdin
from sys import stdout
input = stdin.readline
for __ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if max(a) == min(a):
		print('NO')
	else:
		print('YES')
		ans = 0
		node = -1
		for i in range(n):
			if a[i] != a[0]:
				node = i + 1
				print(1, i + 1)
				ans += 1
		for i in range(1, n):
			if a[i] == a[0]:
				print(node, i + 1)


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	if len(set(a)) == 1:
		print('NO')
	else:
		print('YES')
		c1 = a[0]
		c2 = -1
		for i in range(1, n):
			if a[i] != c1:
				print(1, i + 1)
				c2 = i + 1
		for i in range(1, n):
			if a[i] == c1:
				print(c2, i + 1)


for t in range(int(input())):
	n = int(input())
	M = [int(i) for i in input().split()]
	if len(set(M)) == 1:
		print('NO')
	else:
		print('YES')
		l1 = -1
		for i in range(1, n):
			if M[i] != M[0]:
				print(1, i + 1)
				l1 = i + 1
		for i in range(1, n):
			if M[i] == M[0]:
				print(l1, i + 1)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def fi():
	return float(input())

def si():
	return input()

def msi():
	return map(str, input().split())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	return x * y // gcd(x, y)
mod = 1000000007

def modInverse(b, m):
	g = gcd(b, m)
	if g != 1:
		return -1
	else:
		return pow(b, m - 2, m)

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def modu(a, b, m):
	a = a % m
	inv = modInverse(b, m)
	if inv == -1:
		return -999999999
	else:
		return inv * a % m
from math import log, sqrt, factorial, cos, tan, sin, radians, floor
import bisect
from decimal import *
getcontext().prec = 8
abc = 'abcdefghijklmnopqrstuvwxyz'
pi = 3.141592653589793

def fun(a, n):
	s = 0
	if n == 1:
		return s
	for i in range(n):
		b = []
		b.extend(a[0:i])
		c = a[i + 1:]
		b.extend(c)
		s += fun(b, n - 1)

def isP(n):
	c = 0
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			c += 1
	if c:
		return False
	return True
pr = []
for i in range(101, 1050):
	if isP(i):
		pr.append(i)

def main():
	for _ in range(ii()):
		n = ii()
		a = li()
		if len(set(a)) == 1:
			print('NO')
			continue
		x = a[0]
		print('YES')
		l = []
		c = -1
		for i in range(1, n):
			if a[i] != x:
				print(1, i + 1)
				c = i + 1
			else:
				l.append(i + 1)
		for i in range(len(l)):
			print(c, l[i])
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
from collections import deque
import threading
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if a.count(a[0]) == n:
		print('NO')
	else:
		print('YES')
		ind = 0
		res = []
		for i in range(1, n):
			if a[i] != a[0]:
				res.append((1, i + 1))
				ind = i + 1
		for i in range(1, n):
			if a[i] == a[0]:
				res.append((ind, i + 1))
		for i in res:
			print(*i)


from collections import Counter
for case in range(int(input())):
	n = int(input())
	arr = [int(a) for a in input().split()]
	ans = []
	rem = []
	if len(set(arr)) == 1:
		print('NO')
	else:
		print('YES')
		root = arr[0]
		for i in range(1, n):
			if arr[i] != root:
				ans.append((1, i + 1))
				new = i + 1
			else:
				rem.append(i + 1)
		for i in rem:
			ans.append((new, i))
	for con in ans:
		print(*con)


t = int(input())
for _ in range(t):
	n = int(input())
	line = list(map(int, input().split()))
	tempset = list(set(line))
	if len(tempset) == 1:
		print('NO')
	else:
		check = [0] * n
		check[0] = 1
		box = []
		get = 0
		for i in range(n):
			if line[i] != line[get]:
				elseget = i
				box.append([get + 1, i + 1])
				check[i] = 1
		for i in range(n):
			if check[i] == 0:
				box.append([elseget + 1, i + 1])
				check[i] = 1
		print('YES')
		for i in box:
			print(i[0], i[1])


t = int(input())
for _ in range(t):
	n = int(input())
	li = list(map(int, input().split(' ')))
	if li.count(li[0]) == len(li):
		print('NO')
		continue
	print('YES')
	i = 1
	second = False
	while i < len(li):
		if li[0] == li[i]:
			pass
		else:
			second = i + 1
			print(1, i + 1)
		i += 1
	i = 1
	while i < len(li):
		if li[0] == li[i]:
			print(second, i + 1)
		i += 1


T = int(input())
for z in range(T):
	n = int(input())
	a = [int(x) for x in input().split()]
	ls = list(set(a))
	if len(ls) == 1:
		print('NO')
	else:
		print('YES')
		nex = 0
		ll = []
		for i in range(1, len(a)):
			if a[0] == a[i]:
				ll.append(i + 1)
			else:
				nex = i + 1
				print(1, i + 1)
		for e in ll:
			print(nex, e)


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(item) for item in input().split()]
	if len(set(a)) == 1:
		print('NO')
	else:
		print('YES')
		b = []
		for i in range(1, n):
			if a[0] != a[i]:
				print(f'1 {i + 1}')
				k = i
			else:
				b.append(i)
		for item in b:
			print(f'{k + 1} {item + 1}')


import sys
import math
from collections import defaultdict, deque
input = sys.stdin.readline

def inar():
	return [int(el) for el in input().split()]

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		arr = inar()
		res = []
		take = arr[0]
		second = -1
		for i in range(1, n):
			if arr[i] != take:
				res.append((1, i + 1))
				second = i + 1
		for i in range(1, n):
			if arr[i] == take:
				res.append((second, i + 1))
		if second == -1:
			print('NO')
		else:
			print('YES')
			for i in range(len(res)):
				print(*res[i])
main()


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	f = 1
	for b in range(n):
		if arr[0] != arr[b]:
			f = 0
			print('YES')
			break
	else:
		print('NO')
	if f == 0:
		same = []
		diff = 0
		for i in range(1, n):
			if arr[0] != arr[i]:
				print(1, i + 1)
				diff = i
			else:
				same.append(i)
		for j in same:
			print(diff + 1, j + 1)


def solve(gangs, n):
	waiting = []
	lst = []
	free_node = None
	for i in range(1, n):
		if gangs[0] != gangs[i]:
			lst.append([1, i + 1])
			free_node = i
		else:
			waiting.append(i)
	if len(waiting) != 0 and free_node == None:
		return False
	for i in range(len(waiting)):
		lst.append([free_node + 1, waiting[i] + 1])
	return lst
for _ in range(int(input())):
	n = int(input())
	gangs = list(map(int, input().split()))
	res = solve(gangs, n)
	if res:
		print('YES')
		for i in res:
			print(' '.join([str(i) for i in i]))
	else:
		print('NO')


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	ans = []
	if len(set(l)) == 1:
		sys.stdout.write('NO\n')
		continue
	else:
		x = l[0]
		z = []
		f = -1
		for i in range(1, len(l)):
			y = l[i]
			if x == y:
				z.append(i + 1)
			else:
				ans.append((1, i + 1))
				f = i + 1
		for i in z:
			ans.append((f, i))
	sys.stdout.write('YES\n')
	for i in ans:
		r1 = str(i[0])
		r2 = str(i[1])
		sys.stdout.write(r1 + ' ' + r2 + '\n')


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	x = int(input())
	(*li,) = map(int, input().split())
	if len(set(li)) == 1:
		print('NO')
	else:
		print('YES')
		for i in range(x):
			if li[i] != li[0]:
				print(1, i + 1)
				idx = i
		for i in range(1, x):
			if li[i] == li[0]:
				print(idx + 1, i + 1)


from os import path
import sys
from heapq import heappush, heappop
from functools import cmp_to_key as ctk
from collections import deque, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input().rstrip()

def mi():
	return list(map(int, input().split()))

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def bo(i):
	return ord(i) - ord('a')
file = 1

def solve():
	for _ in range(ii()):
		n = ii()
		a = li()
		if len(set(a)) == 1:
			print('NO')
			continue
		print('YES')
		(ans, p) = ([], [])
		x = a[0]
		y = -1
		for i in range(1, n):
			if a[i] != x:
				y = i + 1
				ans.append([1, i + 1])
			else:
				p.append(i + 1)
		for i in p:
			ans.append([y, i])
		for i in ans:
			print(*i)

def __starting_point():
	if file:
		if path.exists('input.txt'):
			sys.stdin = open('input.txt', 'r')
			sys.stdout = open('output.txt', 'w')
		else:
			input = sys.stdin.readline
	solve()
__starting_point()


from math import *
from sys import *
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	f = 0
	for i in range(n - 1):
		if a[i] != a[i + 1]:
			f = 1
			break
	if f == 0:
		print('NO')
	else:
		print('YES')
		m = []
		x = []
		for i in range(1, n):
			if a[i] != a[0]:
				m.append(i + 1)
			else:
				x.append(i + 1)
		for i in range(len(m)):
			print(1, m[i])
		for i in range(len(x)):
			print(m[-1], x[i])


from sys import maxsize, stdout, stdin
mod = int(1000000000.0 + 7)

def I():
	return int(stdin.readline())

def lint():
	return [int(x) for x in stdin.readline().split()]

def S():
	return input().strip()

def grid(r, c):
	return [lint() for i in range(r)]

def districts():
	n = I()
	ls = lint()
	ans = []
	if len(set(ls)) == 1:
		print('NO')
	else:
		print('YES')
		x = ls[0]
		y = 0
		for i in range(1, n):
			if ls[i] == x:
				ans.append(i + 1)
			else:
				print(1, i + 1)
				y = i + 1
		for i in ans:
			print(y, i)
for _ in range(I()):
	districts()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if a.count(a[0]) == n:
		print('NO')
	else:
		print('YES')
		ans = []
		v = [0] * n
		c = a[0]
		v[0] = 1
		ind = -1
		for i in range(1, n):
			if a[i] != c:
				ans.append([1, i + 1])
				ind = i + 1
				v[i] = 1
		for i in range(1, n):
			if v[i] == 0:
				ans.append([ind, i + 1])
		for i in ans:
			print(i[0], i[1])


t = int(input())
for _ in range(t):
	n = int(input())
	arr = [int(i) for i in input().split()]
	if len(set(arr)) == 1:
		print('NO')
	else:
		print('YES')
		rems = []
		for i in range(1, n):
			if arr[i] != arr[0]:
				print(1, i + 1)
				x = i + 1
			else:
				rems.append(i + 1)
		for i in rems:
			print(x, i)


import math
import sys, bisect
from heapq import *
from itertools import *
from collections import *
sys.setrecursionlimit(10 ** 6)
I = lambda : int(sys.stdin.readline())
neo = lambda : map(int, sys.stdin.readline().split())
Neo = lambda : list(map(int, sys.stdin.readline().split()))
for _ in range(I()):
	n = I()
	A = Neo()
	if len(set(A)) == 1:
		print('NO')
	else:
		print('YES')
		B = []
		for i in range(1, n):
			if A[i] != A[0]:
				print(1, i + 1)
				t = i + 1
			else:
				B += [i + 1]
		for i in B:
			print(t, i)


for _ in range(int(input())):
	n = int(input())
	a = [*map(int, input().split())]
	if a.count(a[0]) == n:
		print('NO')
		continue
	print('YES')
	other = 0
	for i in range(1, n):
		if a[i] != a[0]:
			print(1, i + 1)
			other = i + 1
	for i in range(1, n):
		if a[i] == a[0]:
			print(other, i + 1)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	val = l[0]
	s = set(l)
	if len(s) == 1:
		print('NO')
	else:
		k = []
		o = -1
		print('YES')
		for i in range(1, n):
			if l[i] == val:
				k.append(i + 1)
			else:
				o = i + 1
				print(1, i + 1)
		for i in k:
			print(o, i)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	vis = set()
	vis.add(0)
	if len(set(a)) == 1:
		print('NO')
		continue
	edg = []
	ed = -1
	for i in range(1, n):
		if a[0] != a[i]:
			ed = i
			edg.append([1, i + 1])
	print('YES')
	for i in range(1, n):
		if a[0] == a[i]:
			edg.append([ed + 1, i + 1])
	for i in edg:
		print(*i)


for __ in range(int(input())):
	n = int(input())
	ar = list(map(int, input().split()))
	ans = []
	num = 0
	for i in range(1, n):
		if ar[i] != ar[0]:
			num = i
			ans.append([1, i + 1])
	if len(ans) == 0:
		print('NO')
	else:
		for i in range(1, n):
			if ar[i] == ar[0]:
				ans.append([num + 1, i + 1])
		print('YES')
		for elem in ans:
			print(*elem)


for _ in range(int(input())):
	n = int(input())
	gangs = list(map(int, input().split()))
	same = []
	first = gangs[0]
	s = set(gangs)
	if len(s) == 1:
		print('NO')
	else:
		flag = 0
		print('YES')
		for i in range(1, n):
			if first == gangs[i]:
				same.append(i + 1)
			else:
				flag = i + 1
				print(1, i + 1)
		for i in same:
			print(flag, i)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	a = []
	if l.count(l[0]) == n:
		print('NO')
	else:
		print('YES')
		for i in range(1, n):
			if l[i] != l[0]:
				print('1', i + 1)
				x = i + 1
			else:
				a.append(i + 1)
		for v in a:
			print(x, v)


import sys
from os import path
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
else:
	input = sys.stdin.readline
for t_c_ in range(int(input())):
	n = int(input())
	ar = [int(x) for x in input().split()]
	ans = []
	left = []
	if max(ar) == min(ar):
		print('NO')
		continue
	diff = 0
	for i in range(1, n):
		if ar[i] != ar[0]:
			diff = i
			ans.append((0, i))
		else:
			left.append(i)
	for i in range(len(left)):
		ans.append((diff, left[i]))
	print('YES')
	for (i, j) in ans:
		print(i + 1, j + 1)


t = int(input())
for _ in range(t):
	districts = int(input())
	gang_belong = list(map(int, input().split()))
	if gang_belong.count(gang_belong[0]) == districts:
		print('NO')
		continue
	print('YES')
	root_gang = gang_belong[0]
	for index in range(1, districts):
		if gang_belong[index] != root_gang:
			print(1, index + 1)
			child_gang = index + 1
	for index in range(1, districts):
		if gang_belong[index] == root_gang:
			print(child_gang, index + 1)


n = int(input())
for _ in range(n):
	n = int(input())
	l = list(map(int, input().split()))
	if l.count(l[0]) == n:
		print('NO')
		continue
	else:
		print('YES')
		temp = []
		k = 0
		for i in range(1, n):
			if l[i] != l[0]:
				print('1', i + 1)
				k = i + 1
			else:
				temp.append(i + 1)
		for j in temp:
			print(k, j)


for _ in range(int(input())):
	n = int(input())
	(*arr,) = map(int, input().split())
	if arr.count(arr[0]) == n:
		print('NO')
	else:
		print('YES')
		for i in range(1, n):
			if arr[i] != arr[0]:
				print(1, i + 1)
				other = i
		for i in range(1, n):
			if arr[i] == arr[0]:
				print(other + 1, i + 1)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		print('NO')
		continue
	print('YES')
	not_added = []
	elem = 0
	for i in range(1, n):
		if a[i] != a[0]:
			elem = i + 1
			print(1, i + 1)
		else:
			not_added.append(i + 1)
	for el in not_added:
		print(elem, el)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		print('NO')
		continue
	print('YES')
	for (i, x) in enumerate(a[1:]):
		if x != a[0]:
			print(f'1 {i + 2}')
			other_i = i + 2
			other = x
	for (i, x) in enumerate(a[1:]):
		if x == a[0]:
			print(f'{other_i} {i + 2}')


t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	if len(set(arr)) != 1:
		print('YES')
		a = arr[0]
		res = []
		for j in range(1, n):
			if arr[j] != a:
				b = j + 1
				print(1, j + 1)
			else:
				res.append(j + 1)
		for j in res:
			print(b, j)
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	lst = []
	if a.count(a[0]) != n:
		print('YES')
		for i in range(1, n):
			if a[0] != a[i]:
				k = i + 1
				print(1, i + 1)
			else:
				lst.append(i + 1)
		for val in lst:
			print(k, val)
	else:
		print('NO')


game = int(input())
for i in range(game):
	n = int(input())
	k = list(map(int, input().split()))
	l = [k[0]] * n
	m = []
	if k == l:
		print('NO')
	else:
		print('YES')
		for j in range(1, n):
			if k[0] != k[j]:
				print(1, j + 1)
				final = j + 1
			else:
				m.append(j + 1)
		for value in m:
			print(final, value)


n = int(input())
for i in range(n):
	t = int(input())
	l = list(map(int, input().split()))
	d1 = []
	d2 = []
	c = -1
	for i in range(t):
		if l[i] != l[0]:
			c = i
			d1.append(1)
			d2.append(i + 1)
	if c == -1:
		print('NO')
		continue
	for i in range(1, t):
		if l[i] == l[0]:
			d1.append(c + 1)
			d2.append(i + 1)
	print('YES')
	for i in range(len(d1)):
		print(d1[i], d2[i])


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import math
from collections import Counter, defaultdict, deque

def int1():
	return int(input())

def map1():
	return map(int, input().split())

def list1():
	return list(map(int, input().split()))
mod = pow(10, 9) + 7

def solve():
	n = int1()
	l1 = list1()
	s = list(set(l1))
	if len(s) == 1:
		print('NO')
	else:
		print('YES')
		for i in range(1, n):
			if l1[0] != l1[i]:
				print(1, i + 1)
				v = i + 1
		for i in range(1, n):
			if l1[0] == l1[i]:
				print(v, i + 1)
for _ in range(int(input())):
	solve()


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	x = l[0]
	if len(l) == l.count(x):
		print('NO')
	else:
		print('YES')
		z = []
		for i in range(1, n):
			if l[i] != x:
				print(1, i + 1)
				y = i + 1
			else:
				z.append(i + 1)
		for i in range(len(z)):
			print(y, z[i])


q = int(input())
for f in range(q):
	n = int(input())
	arr = [int(x) for x in input().split()]
	eq = True
	for x in range(n - 1):
		if arr[x] != arr[x + 1]:
			eq = False
	if eq:
		print('NO')
	else:
		print('YES')
		j = 0
		for i in range(n):
			if arr[0] != arr[i]:
				print(1, i + 1)
				j = i
		for i in range(n):
			if i == 0:
				continue
			if arr[0] == arr[i]:
				print(j + 1, i + 1)


import sys, io, os, time
from collections import defaultdict
from collections import Counter
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect, math, heapq
alphabet = 'abcdefghijklmnopqrstuvwxyz'
input = sys.stdin.readline
for ii in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	ans = []
	mapka = defaultdict(list)
	for i in range(n):
		mapka[arr[i]].append(i)
	ele = set(arr)
	if len(ele) == 1:
		print('NO')
		continue
	ans = []
	last = 0
	for i in range(1, n):
		if arr[0] != arr[i]:
			last = i
			ans.append([1, i + 1])
	for i in range(1, n):
		if arr[0] == arr[i]:
			ans.append([last + 1, i + 1])
	print('YES')
	for i in ans:
		print(*i)


import os
from io import BytesIO, IOBase
import sys
from collections import defaultdict, deque, Counter
from bisect import *
from math import sqrt, pi, ceil
import math
from itertools import permutations
from copy import deepcopy
from sys import setrecursionlimit

def main():
	for _ in range(int(input())):
		n = int(input())
		a = list(map(int, input().split()))
		b = set(a)
		if len(b) == 1:
			print('NO')
		else:
			print('YES')
			t = 0
			for i in range(1, n):
				if a[0] != a[i]:
					print(1, i + 1)
					t = i
			for i in range(1, n):
				if a[0] == a[i]:
					print(t + 1, i + 1)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def ans(a, n):
	if max(a) == min(a):
		print('NO')
		return
	print('YES')
	connected = [0] * n
	roads = 0
	connected[0] = 1
	j = 0
	for i in range(1, n):
		if roads == n - 1:
			break
		if a[i] != a[0]:
			connected[i] = 1
			j = i
			print(str(1) + ' ' + str(i + 1))
			roads += 1
	for i in range(1, n):
		if roads == n - 1:
			break
		if connected[i] == 0 and a[i] != a[j]:
			connected[i] = 1
			print(str(j + 1) + ' ' + str(i + 1))
	return
m = int(input())
for j in range(m):
	n = int(input())
	arr = input().split()
	a = []
	for i in arr:
		a.append(int(i))
	ans(a, n)


t = int(input())
for i in range(t):
	B = []
	n = int(input())
	A = list(map(int, input().split()))
	if len(set(A)) == 1:
		print('NO')
	else:
		print('YES')
		a = A[0]
		b = -1
		for i in range(1, len(A)):
			if A[i] != a:
				b = i + 1
				print(1, i + 1)
			elif A[i] == a:
				B.append(i + 1)
		for j in B:
			print(b, j)


l = int(input())
while l:
	p = input()
	n = list(map(int, input().split()))
	y = []
	if len(set(n)) == 1:
		print('NO')
	else:
		print('YES')
		ff = 0
		for i in range(1, len(n)):
			if n[0] != n[i]:
				print(1, i + 1)
				f = i + 1
			else:
				y.append(i + 1)
				ff = 1
		if ff == 1:
			for i in range(len(y)):
				print(f, y[i])
	l -= 1


for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	m = a[0]
	b = []
	f = -5
	count = 0
	c = []
	add = 0
	for i in range(1, n):
		if a[i] == m:
			b.append(i + 1)
			count += 1
		else:
			c.append(i + 1)
			add += 1
			f = i + 1
	if f == -5:
		print('NO')
		continue
	print('YES')
	for i in range(add):
		print(1, c[i])
	for i in range(count):
		print(f, b[i])


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		print('NO')
	elif len(set(a)) == n:
		print('YES')
		for i in range(1, n):
			print(1, i + 1)
	else:
		print('YES')
		p = a[0]
		r = []
		q = 0
		for i in range(1, n):
			if p == a[i]:
				r.append(i + 1)
			else:
				print(1, i + 1)
				q = i + 1
		for x in r:
			print(q, x)


t = int(input())
for i in range(t):
	n = int(input())
	b = list(map(int, input().split()))
	if len(set(b)) == 1:
		print('NO')
	else:
		ini = b[0]
		j = 1
		res = []
		while j < n:
			if b[j] != ini:
				res.append([1, j + 1])
				q = j + 1
			j += 1
		j = 1
		while j < n:
			if b[j] == ini:
				res.append([q, j + 1])
			j += 1
		print('YES')
		for j in res:
			print(*j)


import sys
from sys import stdin as sysstdin
t = int(sysstdin.readline().strip())
for _ in range(0, int(t)):
	n = int(sysstdin.readline().strip())
	a = [int(x) for x in sysstdin.readline().split()]
	if a.count(max(a)) == n:
		print('NO')
	else:
		print('YES')
		for i in range(0, len(a)):
			if a[i] != a[0]:
				print(1, i + 1)
				b = a[i]
				j = i
		for i in range(1, len(a)):
			if a[i] == a[0]:
				print(j + 1, i + 1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		print('NO')
		continue
	print('YES')
	ans = []
	idx = -1
	for i in range(1, n):
		if a[i] != a[0]:
			idx = i
			ans.append([1, i + 1])
	for i in range(1, n):
		if a[i] == a[0]:
			ans.append([idx + 1, i + 1])
	for i in ans:
		print(*i)


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
BUFSIZE = 8192
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		a = list(map(int, input().split()))
		idx = -1
		res = []
		for i in range(1, n):
			if a[i] != a[0]:
				idx = i
				res.append((1, i + 1))
		if idx == -1:
			print('NO')
			continue
		for i in range(1, n):
			if a[i] == a[0]:
				res.append((idx + 1, i + 1))
		print('YES')
		for r in res:
			print(r[0], r[1])
main()


t = int(input())
for i in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	d = A[0]
	B = []
	x = 0
	f = True
	for j in range(1, n):
		if A[j] != d:
			if f:
				print('YES')
				f = False
			print(1, j + 1)
			x = j + 1
		else:
			B.append(j + 1)
	if f:
		print('NO')
	else:
		for j in B:
			print(x, j)


for _ in range(int(input())):
	n = int(input())
	a = [x for x in map(int, input().split())]
	ans = []
	idx = -1
	for i in range(1, n):
		if a[0] != a[i]:
			idx = i
			ans.append([1, i + 1])
	if idx == -1:
		print('NO')
		continue
	for i in range(1, n):
		if a[0] == a[i]:
			ans.append([idx + 1, i + 1])
	print('YES')
	for i in ans:
		print(*i)


for _ in range(int(input())):
	n = int(input())
	data = [int(x) for x in input().split()]
	if len(set(data)) == 1:
		print('NO')
	else:
		print('YES')
		visited = [0] * (n + 1)
		visited[1] = 1
		temp = data[0]
		for q in range(2, n + 1):
			if data[q - 1] != temp:
				visited[q] = 1
				pos = q
				print(1, q)
		visited[pos] = 1
		for q in range(2, n + 1):
			if visited[q] == 0:
				print(pos, q)


from sys import stdin, stdout
import math
import heapq
import collections
input = stdin.readline

def inputnum():
	return int(input())

def inputnums():
	return map(int, input().split())

def inputlist():
	return list(map(int, input().split()))

def inputstring():
	return [x for x in input()]

def inputstrings():
	return [x for x in input().split()]

def inputstringnum():
	return [ord(x) - ord('a') for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
t = int(input())
for q in range(t):
	n = inputnum()
	a = inputlist()
	if max(a) == min(a):
		print('NO')
		continue
	else:
		print('YES')
	x = 0
	for i in range(1, n):
		if a[i] != a[0]:
			x = i + 1
			print(1, i + 1)
	for i in range(1, n):
		if a[i] == a[0]:
			print(x, i + 1)


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	if len(set(a)) == 1:
		print('NO')
	else:
		print('YES')
		start = a[0]
		m = []
		z = 0
		for i in range(1, n):
			if a[i] != start:
				print(1, i + 1)
				z = i + 1
			else:
				m.append(i + 1)
		for i in m:
			print(z, i)


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	l = list(map(int, input().split()))
	ans = []
	ind = -1
	for i in range(1, n):
		if l[i] != l[0]:
			ans.append([1, i + 1])
			ind = i
	if ind == -1:
		print('NO')
	else:
		for i in range(1, n):
			if l[i] == l[0]:
				ans.append([ind + 1, i + 1])
		print('YES')
		for i in ans:
			print(i[0], i[1])


t = int(input())
for z in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	freq = {}
	for i in range(n):
		if arr[i] in freq:
			freq[arr[i]] += 1
		else:
			freq[arr[i]] = 1
	arrvalues = list(freq.values())
	if len(arrvalues) == 1:
		print('NO')
		continue
	print('YES')
	key = arr[0]
	min = 0
	for i in range(n):
		if arr[i] != key:
			print(1, i + 1)
			min = i
	for i in range(1, n):
		if arr[i] == key:
			print(min + 1, i + 1)


from collections import deque
for t in range(int(input())):
	n = int(input())
	(*a,) = map(int, input().split())
	used = [False] * n
	used[0] = True
	q = deque([0])
	ans = []
	while q:
		v = q.popleft()
		for u in range(n):
			if a[v] != a[u] and (not used[u]):
				ans.append([v, u])
				q.appendleft(u)
				used[u] = True
	if len(ans) == n - 1:
		print('YES')
		for (u, v) in ans:
			print(u + 1, v + 1)
	else:
		print('NO')


import os
from heapq import heapify, heappop, heappush
import sys
import math
import operator
import bisect
from collections import defaultdict
from io import BytesIO, IOBase
sys.setrecursionlimit(10 ** 5)

def inpt():
	return [int(k) for k in input().split()]

def main():
	for _ in range(int(input())):
		n = int(input())
		ar = inpt()
		st = set(ar)
		if len(st) == 1:
			print('NO')
			continue
		u = ar[0]
		ans = []
		nt = -1
		for i in range(1, n):
			if ar[i] != u:
				ans.append((1, i + 1))
				nt = i + 1
		for i in range(1, n):
			if ar[i] == u:
				ans.append((nt, i + 1))
		print('YES')
		for i in ans:
			print(i[0], i[1])
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from math import sqrt
from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	l = list(map(int, stdin.readline().split()))
	shan = 0
	sree = l[0]
	siri = []
	mps = []
	for i in range(1, n):
		if l[i] != sree:
			shan = i + 1
			mps.append([1, i + 1])
		else:
			siri.append(i + 1)
	if shan > 0:
		print('YES')
		for i in siri:
			mps.append([shan, i])
		for e in mps:
			print(*e)
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	st = set(a)
	if len(st) == 1:
		ans = -1
	else:
		l = []
		rt = a[0]
		sec = -1
		for i in range(1, n):
			if a[i] != rt:
				l.append((1, i + 1))
				sec = i + 1
		for i in range(1, n):
			if rt == a[i]:
				l.append((sec, i + 1))
		ans = 1
	if ans == -1:
		print('NO')
	else:
		print('YES')
		for i in l:
			print(i[0], i[1])


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	res = 0
	axx = []
	if min(a) == max(a):
		print('NO')
	else:
		print('YES')
		for i in range(1, len(a)):
			if a[i] != a[0]:
				print(1, i + 1)
				res = i
			else:
				axx.append(i)
		for k in range(len(axx)):
			print(res + 1, axx[k] + 1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = []
	q = -1
	if max(a) * n == sum(a):
		print('NO')
		continue
	print('YES')
	for i in range(1, n):
		if a[0] != a[i]:
			print(1, i + 1)
			q = i + 1
		else:
			b.append(i + 1)
	for i in range(len(b)):
		print(q, b[i])


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	A = list(map(int, input().split(' ')))
	if A.count(A[0]) == n:
		print('NO')
	else:
		print('YES')
		d1 = A[0]
		for i in range(1, n):
			if A[i] != d1:
				d2 = A[i]
				d2_in = i
		check = [1] * n
		check[0] = 0
		for i in range(1, n):
			if A[i] != d1:
				print(1, i + 1)
				check[i] = 0
		for i in range(n):
			if A[i] != d2 and check[i] == 1:
				print(d2_in + 1, i + 1)
				check[i] = 0


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	ans = []
	root = arr[0]
	visited = [False] * n
	visited[0] = True
	temp = 0
	for i in range(1, n):
		if arr[i] != root:
			ans.append([1, i + 1])
			visited[i] = True
			temp = i
	if len(ans) == 0:
		print('NO')
		continue
	for i in range(n):
		if visited[i] is False:
			ans.append([temp + 1, i + 1])
	print('YES')
	for i in ans:
		print(*i)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	cur = a[0]
	if a.count(a[0]) == n:
		print('NO')
	else:
		print('YES', end='\n')
		b = [0 for j in range(n)]
		b[0] = 1
		for i in range(1, n):
			if a[i] != a[0]:
				b[i] = 1
				flag = i + 1
				print(1, i + 1, end='\n')
		for i in range(n):
			if a[i] == a[0] and b[i] == 0:
				print(flag, i + 1, end='\n')


from collections import Counter
from collections import OrderedDict
from collections import defaultdict
import bisect

def freq_count(mylist):
	return Counter(mylist)
t = int(input())
for _ in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	set1 = set(arr)
	if len(set1) < 2:
		print('NO')
		continue
	print('YES')
	c = n - 1
	for i in range(1, n):
		if arr[i] != arr[0]:
			print(1, i + 1)
			get = i + 1
			c -= 1
	i = 1
	while c > 0:
		if arr[i] == arr[0]:
			print(get, i + 1)
			c -= 1
		i += 1


from collections import Counter
import string
import math
import sys
from fractions import Fraction

def array_int():
	return [int(i) for i in sys.stdin.readline().split()]

def vary(arrber_of_variables):
	if arrber_of_variables == 1:
		return int(sys.stdin.readline())
	if arrber_of_variables >= 2:
		return map(int, sys.stdin.readline().split())

def makedict(var):
	return dict(Counter(var))

def printDivisors(n):
	divisors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				divisors.append(i)
			else:
				divisors.extend((i, n // i))
		i = i + 1
	return divisors

def countTotalBits(num):
	binary = bin(num)[2:]
	return len(binary)

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
for _ in range(vary(1)):
	n = vary(1)
	num = array_int()
	if len(set(num)) == 1:
		print('NO')
	else:
		print('YES')
		z = 0
		for i in range(1, n):
			if num[z] != num[i]:
				pos = i
				print(z + 1, i + 1)
		indi = []
		for i in range(1, n):
			if num[0] == num[i]:
				indi.append(i)
			else:
				pos = i
		if len(indi) == 0:
			continue
		else:
			for i in indi:
				print(pos + 1, i + 1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = set(a)
	if len(b) == 1:
		print('NO')
	else:
		print('YES')
		f = -1
		for i in range(0, n):
			if a[i] != a[0]:
				f = i + 1
				print(1, i + 1)
		for i in range(1, n):
			if a[i] == a[0]:
				print(f, i + 1)


from sys import stdin, stdout
from os import path
if path.exists('input.txt'):
	stdin = open('input.txt', 'r')
for _ in range(int(stdin.readline())):
	x = int(stdin.readline())
	mylist = list(map(int, stdin.readline().strip().split()))
	out = []
	idx = -1
	for i in range(1, x):
		if mylist[i] != mylist[0]:
			idx = i + 1
			out.append((1, i + 1))
	if idx == -1:
		print('NO')
		continue
	for i in range(1, x):
		if mylist[i] == mylist[0]:
			out.append((idx, i + 1))
	print('YES')
	for (f, l) in out:
		stdout.write(str(f) + ' ' + str(l) + '\n')


for _ in range(int(input())):
	n = int(input())
	a = [*map(int, input().split())]
	t = a[0]
	if len(a) == a.count(t):
		print('NO')
	else:
		print('YES')
		ans = []
		for i in range(1, n):
			if a[i] != t:
				print(1, i + 1)
				x = i + 1
			else:
				ans.append(i + 1)
		for i in range(len(ans)):
			print(x, ans[i])


import sys
import math
import collections
input = sys.stdin.readline

def algo(n, arr):
	ans = []
	idx = -1
	for i in range(1, n):
		if arr[i] != arr[0]:
			idx = i
			ans.append((1, i + 1))
	if idx == -1:
		print('NO')
		return
	for i in range(1, n):
		if arr[i] == arr[0]:
			ans.append((idx + 1, i + 1))
	print('YES')
	for item in ans:
		print(*item)
for _ in range(int(input())):
	n = int(input().strip())
	arr = list(map(int, input().split()))
	res = algo(n, arr)


import sys
import math
from collections import Counter
from collections import OrderedDict
from functools import reduce
sys.setrecursionlimit(10 ** 6)

def inputt():
	return sys.stdin.readline().strip()

def printt(n):
	sys.stdout.write(str(n) + '\n')

def listt():
	return [int(i) for i in inputt().split()]

def gcd(a, b):
	return math.gcd(a, b)

def lcm(a, b):
	return a * b // gcd(a, b)

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
t = int(inputt())
for _ in range(t):
	n = int(inputt())
	s = listt()
	g = set(s)
	k = 0
	if len(g) < 2:
		printt('NO')
	else:
		printt('YES')
		for i in range(1, n):
			if s[0] != s[i]:
				print(1, i + 1)
				k = i
		for i in range(1, n):
			if s[0] == s[i]:
				print(k + 1, i + 1)


for iiii in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	k = 0
	tmp = lst[0]
	two = 0
	answer = set()
	for i in range(1, n):
		if lst[i] != tmp:
			answer.add((1, i + 1))
			k += 1
			two = i + 1
	if k == 0:
		print('NO')
		continue
	else:
		print('YES')
		for (i, j) in answer:
			print(i, j)
	for i in range(1, n):
		if lst[i] == tmp:
			print(two, i + 1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = set(a)
	d = {}
	if len(b) == 1:
		print('NO')
	else:
		x = a[0]
		print('YES')
		for i in range(n):
			if a[i] != x:
				y = i + 1
				d[1, y] = 0
				print(1, y)
		for i in range(n):
			if a[i] == x and (i + 1, y) not in d:
				print(y, i + 1)


t = int(input())
while t:
	t -= 1
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	if a.count(m) == n:
		print('NO')
		continue
	j = -1
	print('YES')
	for i in range(n):
		if a[i] == a[0]:
			continue
		j = i
		print(1, i + 1)
	for i in range(1, n):
		if a[i] == a[0]:
			print(j + 1, i + 1)


for test in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	solution = []
	idx = -1
	for i in range(1, len(arr)):
		if arr[0] != arr[i]:
			solution.append((1, i + 1))
			idx = i
	if idx == -1:
		print('NO')
		continue
	for i in range(1, len(arr)):
		if arr[i] == arr[0]:
			solution.append((idx + 1, i + 1))
	print('YES')
	for (i, j) in solution:
		print(str(i) + ' ' + str(j))


import sys
import math
from collections import defaultdict, deque
input = sys.stdin.readline

def inar():
	return [int(el) for el in input().split()]

def main():
	for _ in range(int(input())):
		n = int(input())
		arr = inar()
		sttt = set(arr)
		if len(sttt) == 1:
			print('NO')
			continue
		take = arr[0]
		result = []
		total = -1
		for i in range(1, n):
			if arr[i] != take:
				result.append((1, i + 1))
				total = i + 1
		for i in range(1, n):
			if arr[i] == take:
				result.append((total, i + 1))
		print('YES')
		for i in result:
			print(i[0], i[1])
main()


ans = []
for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		ans += [['NO']]
	else:
		ans += [['YES']]
		bad = []
		for i in range(1, n):
			if a[i] != a[0]:
				ans += [(1, i + 1)]
			else:
				bad += [i + 1]
		for i in range(n - 1, -1, -1):
			if a[i] != a[0]:
				for el in bad:
					ans += [(i + 1, el)]
				break
[print(*i) for i in ans]


import os, sys
from io import BytesIO, IOBase

def main():
	for _ in range(int(input())):
		n = int(input())
		arr = list(map(int, input().split()))
		if len(set(arr)) == 1:
			print('NO')
			continue
		print('YES')
		xx = -1
		for (ind, val) in enumerate(arr):
			if val != arr[0]:
				xx = ind + 1
				print(1, ind + 1)
		for (ind, val) in enumerate(arr):
			if val == arr[0] and ind:
				print(xx, ind + 1)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def solve(arr, n):
	res = []
	root = arr[0]
	idx = -1
	for i in range(1, n):
		if arr[i] != root:
			idx = i
			res.append([1, i + 1])
	if idx == -1:
		print('NO')
		return
	for i in range(1, n):
		if arr[i] == root:
			res.append([idx + 1, i + 1])
	print('YES')
	for (k, v) in res:
		print('{} {}'.format(k, v))

def main():
	t = int(input())
	for q_itr in range(t):
		n = int(input())
		arr = list(map(int, input().split()))
		solve(arr, n)
main()


def ass(a, b):
	print(f'Assertion error: {a} != {b}' if a != b else 'OK')

def rx():
	return [s.rstrip() for s in open(0)]

def nrxs(s):
	return [int(i) for i in s.split()]

def f(a):
	k = -1
	res = []
	b = []
	for i in range(1, len(a)):
		if a[0] != a[i]:
			res.append([1, i + 1])
			k = i
		else:
			b.append(i)
	if k != -1:
		for item in b:
			res.append([k + 1, item + 1])
	return res
for s in rx()[2::2]:
	res = f(nrxs(s))
	print('NO' if res == [] else 'YES')
	for item in res:
		print(*item)


import os
import sys
from math import factorial
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
readint = lambda : int(sys.stdin.readline().rstrip('\r\n'))
readints = lambda : map(int, sys.stdin.readline().rstrip('\r\n').split())
readstr = lambda : sys.stdin.readline().rstrip('\r\n')
readstrs = lambda : map(str, sys.stdin.readline().rstrip('\r\n').split())
readarri = lambda : [int(_) for _ in sys.stdin.readline().rstrip('\r\n').split()]
readarrs = lambda : [str(_) for _ in sys.stdin.readline().rstrip('\r\n').split()]

def main():
	for _ in range(readint()):
		n = readint()
		a = readarri()
		res = []
		idx = -1
		for i in range(1, n):
			if a[i] != a[0]:
				idx = i
				res.append([1, i + 1])
		if idx == -1:
			print('NO')
			continue
		for i in range(1, n):
			if a[i] == a[0]:
				res.append([idx + 1, i + 1])
		print('YES')
		for i in res:
			print(*i)
main()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	ans = []
	b = []
	b += a
	b.sort()
	if b[0] == b[n - 1]:
		print('NO')
	else:
		y = 0
		for i in range(1, n):
			if a[0] != a[i]:
				ans += [0 + 1, i + 1]
				y = i
		for i in range(1, n):
			if a[i] == a[0]:
				ans += [y + 1, i + 1]
		print('YES')
		for i in range(int(len(ans) / 2)):
			print(ans[i * 2], ans[i * 2 + 1])


for _ in range(int(input())):
	n = int(input())
	ls = list(map(int, input().split()))
	a1 = ls[0]
	if len(ls) == ls.count(a1):
		print('NO')
	else:
		print('YES')
		c = []
		ind = 0
		for i in range(1, n):
			if ls[i] != a1:
				print(1, i + 1)
				ind = i + 1
			else:
				c.append(i + 1)
		for i in range(len(c)):
			print(ind, c[i])


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nsmallest
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
from decimal import Decimal
from copy import deepcopy
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var, end='\n'):
	sys.stdout.write(str(var) + end)

def outa(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return list(map(int, data().split()))

def ssp():
	return list(map(str, data().split()))

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
for _ in range(int(data())):
	n = int(data())
	arr = l()
	if len(set(arr)) == 1:
		out('NO')
		continue
	out('YES')
	(no, L) = (-1, [])
	for i in range(1, n):
		if arr[i] == arr[0]:
			L.append(i + 1)
		else:
			no = i + 1
			outa(1, i + 1)
	for i in L:
		outa(no, i)


t = int(input())
for i in range(t):
	n = int(input())
	dist = list(map(int, input().split(' ')))
	unused_idx = []
	a1 = dist[0]
	ans = []
	idx = -1
	for i in range(1, n):
		if dist[i] != a1:
			ans.append((1, i + 1))
			idx = i + 1
		else:
			unused_idx.append(i + 1)
	if idx == -1:
		print('NO')
		continue
	for i in unused_idx:
		ans.append((idx, i))
	print('YES')
	for i in ans:
		print(f'{i[0]} {i[1]}')


from collections import *
from functools import *
import math
import sys
inp = sys.stdin.readline
out = sys.stdout.write

def mi():
	return map(int, inp().split())

def li():
	return list(mi())

def ii():
	return int(inp())

def main():
	for _ in range(ii()):
		n = ii()
		a = li()
		x = a[0]
		if n == a.count(x):
			print('NO')
		else:
			print('YES')
			z = []
			y = None
			for i in range(1, n):
				if a[i] != x:
					print(1, i + 1)
					y = i + 1
				else:
					z.append(i + 1)
			for i in z:
				print(y, i)
main()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if a.count(a[0]) == n:
		print('NO')
	else:
		print('YES')
		G1 = []
		g1 = a[0]
		for i in range(1, n):
			if a[i] != g1:
				print(1, i + 1)
				g2 = i + 1
			else:
				G1.append(i + 1)
		for i in G1:
			print(g2, i)


from sys import stdout, stdin
from collections import defaultdict, deque
import math
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	l = list(map(int, stdin.readline().split()))
	flag = True
	for i in range(1, n):
		if l[i] != l[0]:
			flag = False
			break
	if flag:
		print('NO')
	else:
		print('YES')
		v = [0] * n
		ind = -1
		v[0] = 1
		for i in range(n):
			if l[i] != l[0]:
				ind = i
				print(1, i + 1)
				v[i] = 1
		for i in range(n):
			if v[i] == 0:
				print(ind + 1, i + 1)


for t in range(int(input())):
	input()
	arr = list(map(int, input().split()))
	lefts = []
	f = arr[0]
	ls = None
	check = False
	for i in range(1, len(arr)):
		if arr[i] == f:
			lefts.append(i + 1)
		else:
			if not check:
				print('YES')
				check = True
			print(1, i + 1, sep=' ')
			ls = i + 1
	if ls:
		for lf in lefts:
			print(ls, lf, sep=' ')
	else:
		print('NO')


for _ in range(int(input())):
	x = int(input())
	l = list(map(int, input().split()))
	q = 0
	if l.count(l[0]) == x:
		print('NO')
	else:
		print('YES')
		p = []
		np = l[0]
		for n in range(1, x):
			if np == l[n]:
				p.append(n)
			else:
				print(1, n + 1)
				q = n + 1
		if len(p) != 0:
			for nn in p:
				print(q, nn + 1)


import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	n = int(input())
	A = list(map(int, input().split()))
	D = {}
	flag = 0
	for i in range(n):
		if A[i] in D:
			D[A[i]].append(i + 1)
		else:
			D[A[i]] = [i + 1]
			flag = flag + 1
	if flag == 1:
		print('NO')
	else:
		print('YES')
		v = A[0]
		v1 = 0
		for i in range(n):
			if i + 1 not in D[v]:
				print(D[v][0], i + 1)
				v1 = i + 1
		l = len(D[v])
		for i in range(1, l):
			print(v1, D[v][i])


for _ in range(int(input())):
	n = int(input())
	L = list(map(int, input().split()))
	if len(set(L)) == 1:
		print('NO')
	else:
		M = []
		x = L[0]
		for i in range(1, n):
			if L[i] != L[0]:
				M.append(1)
				M.append(i + 1)
				y = i
		for i in range(1, n):
			if L[i] == L[0]:
				M.append(y + 1)
				M.append(i + 1)
		print('YES')
		for k in range(0, 2 * n - 2 - 1, 2):
			print(M[k], M[k + 1])


def zip_sorted(a, b):
	(a, b) = zip(*sorted(zip(a, b)))
	sorted(zip(a, b), key=lambda x: x[1])
	return (a, b)
t = int(input())
for t1 in range(t):
	n = int(input())
	a = [int(n1) for n1 in input().split()]
	n1 = a[0]
	last = -1
	same = []
	res = all((ele == a[0] for ele in a))
	if res:
		print('NO')
	else:
		print('YES')
		for i in range(1, len(a)):
			if n1 == a[i]:
				same.append(i)
			else:
				print(1, i + 1)
				last = i
		for j in range(len(same)):
			print(last + 1, same[j] + 1)


t = int(input())
for i in range(t):
	n = int(input())
	discs = [int(k) for k in input().split()]
	res = []
	indice = -1
	for i in range(1, n):
		if discs[i] != discs[0]:
			indice = i
			res.append((1, i + 1))
	if indice == -1:
		print('NO')
		continue
	for i in range(1, n):
		if discs[i] == discs[0]:
			res.append((indice + 1, i + 1))
	print('YES')
	for i in res:
		print(i[0], i[1])