You are given $k$ sequences of integers. The length of the $i$-th sequence equals to $n_i$.

You have to choose exactly two sequences $i$ and $j$ ($i \ne j$) such that you can remove exactly one element in each of them in such a way that the sum of the changed sequence $i$ (its length will be equal to $n_i - 1$) equals to the sum of the changed sequence $j$ (its length will be equal to $n_j - 1$).

Note that it's required to remove exactly one element in each of the two chosen sequences.

Assume that the sum of the empty (of the length equals $0$) sequence is $0$.


-----Input-----

The first line contains an integer $k$ ($2 \le k \le 2 \cdot 10^5$) — the number of sequences.

Then $k$ pairs of lines follow, each pair containing a sequence.

The first line in the $i$-th pair contains one integer $n_i$ ($1 \le n_i < 2 \cdot 10^5$) — the length of the $i$-th sequence. The second line of the $i$-th pair contains a sequence of $n_i$ integers $a_{i, 1}, a_{i, 2}, \dots, a_{i, n_i}$.

The elements of sequences are integer numbers from $-10^4$ to $10^4$.

The sum of lengths of all given sequences don't exceed $2 \cdot 10^5$, i.e. $n_1 + n_2 + \dots + n_k \le 2 \cdot 10^5$.


-----Output-----

If it is impossible to choose two sequences such that they satisfy given conditions, print "NO" (without quotes). Otherwise in the first line print "YES" (without quotes), in the second line — two integers $i$, $x$ ($1 \le i \le k, 1 \le x \le n_i$), in the third line — two integers $j$, $y$ ($1 \le j \le k, 1 \le y \le n_j$). It means that the sum of the elements of the $i$-th sequence without the element with index $x$ equals to the sum of the elements of the $j$-th sequence without the element with index $y$.

Two chosen sequences must be distinct, i.e. $i \ne j$. You can print them in any order.

If there are multiple possible answers, print any of them.


-----Examples-----
Input
2
5
2 3 1 3 2
6
1 1 2 2 2 1

Output
YES
2 6
1 2

Input
3
1
5
5
1 1 1 1 1
2
2 3

Output
NO

Input
4
6
2 2 2 2 2 2
5
2 2 2 2 2
3
2 2 2
5
2 2 2 2 2

Output
YES
2 2
4 1



-----Note-----

In the first example there are two sequences $[2, 3, 1, 3, 2]$ and $[1, 1, 2, 2, 2, 1]$. You can remove the second element from the first sequence to get $[2, 1, 3, 2]$ and you can remove the sixth element from the second sequence to get $[1, 1, 2, 2, 2]$. The sums of the both resulting sequences equal to $8$, i.e. the sums are equal.

Difficulty: MEDIUM
Tags: Sorting

Implementation
Skill types: Sorting

Starter code:

Solutions:
n = int(input())
dictx = {}
flag = True
ans = []
for i in range(n):
	k = int(input())
	seq = list(map(int, input().split()))
	if flag:
		sumx = sum(seq)
		for j in range(k):
			key = sumx - seq[j]
			if key in dictx.keys():
				if dictx[key][0] != i + 1:
					ans.append(dictx[key])
					ans.append([i + 1, j + 1])
					flag = False
					break
			else:
				dictx[key] = [i + 1, j + 1]
if flag:
	print('NO')
else:
	print('YES')
	for i in ans:
		print(*i)


def sum_without_one(arr, i):
	s = sum(arr)
	return [[s - x, (i + 1, j + 1)] for (j, x) in enumerate(arr)]
res = []
for i in range(int(input())):
	input()
	res.extend(sum_without_one(list(map(int, input().split())), i))
res.sort()
prev = res[0]
for curr in res[1:]:
	if prev[0] == curr[0] and prev[1][0] != curr[1][0]:
		print('YES')
		print(*prev[1])
		print(*curr[1])
		break
	prev = curr
else:
	print('NO')


n = int(input())
d = {}
res = []
for i in range(n):
	m = int(input())
	a = [int(e) for e in input().split()]
	if not res:
		s = sum(a)
		for j in range(m):
			s1 = s - a[j]
			if s1 not in d:
				d[s1] = (i + 1, j + 1)
			elif d[s1][0] != i + 1:
				res = [d[s1], (i + 1, j + 1)]
				break
if res:
	print('YES')
	print(res[0][0], res[0][1])
	print(res[1][0], res[1][1])
else:
	print('NO')


k = int(input())
r = {}
for i in range(k):
	n = int(input())
	a = tuple(map(int, input().split()))
	s = sum(a)
	for j in range(n):
		x = s - a[j]
		if x in r:
			if r[x][0] == i + 1:
				continue
			print('YES')
			print(*r[x])
			print(i + 1, j + 1)
			exit()
		else:
			r[x] = [i + 1, j + 1]
print('NO')


k = int(input())
sequences = []
for _ in range(k):
	input()
	sequences.append([int(x) for x in input().split()])
sums = {}
found = False
for (si, s) in enumerate(sequences):
	if found:
		break
	sequence_sum = 0
	for value in s:
		sequence_sum += value
	for (i, value) in enumerate(s):
		sum = sequence_sum - value
		if sum in sums and sums[sum][0] != si:
			print('YES')
			print(str(sums[sum][0] + 1) + ' ' + str(sums[sum][1] + 1))
			print(str(si + 1) + ' ' + str(i + 1))
			found = True
			break
		sums[sum] = (si, i)
if not found:
	print('NO')


k = int(input())
b = []
f = False
for i in range(k):
	n = int(input())
	a = [int(i) for i in input().split()]
	s = sum(a)
	for j in range(n):
		b.append((s - a[j], j + 1, i + 1))
b.sort()
for i in range(len(b) - 1):
	if b[i][0] == b[i + 1][0] and b[i][2] != b[i + 1][2]:
		print('YES')
		print(b[i][2], b[i][1])
		print(b[i + 1][2], b[i + 1][1])
		f = True
		break
if not f:
	print('NO')


k = int(input())
result = None
result_list_1 = None
result_list_2 = None
d = {}
for i in range(k):
	n = int(input())
	s = [int(x) for x in input().split(' ')]
	all_sum = sum(s)
	if result is None or result_list_1 is None or result_list_2 is None:
		for j in range(n):
			current = all_sum - s[j]
			result = d.get(current, None)
			if result is not None and result[0] != i + 1:
				result_list_1 = [i + 1, j + 1]
				result_list_2 = [result[0], result[1]]
				break
			d[current] = [i + 1, j + 1]
if result is None or result_list_1 is None or result_list_2 is None:
	print('NO')
else:
	print('YES')
	print('{} {}'.format(result_list_1[0], result_list_1[1]))
	print('{} {}'.format(result_list_2[0], result_list_2[1]))


from sys import *

def input():
	return stdin.read().splitlines()[2::2]

def main():
	a = {}
	for (i, v) in enumerate(input(), 1):
		s = list(map(int, v.split()))
		qw = sum(s)
		for (o, v1) in enumerate(s, 1):
			v1 -= qw
			if v1 in a:
				if a[v1][0] != i:
					print('YES\n%d %d' % a[v1])
					print(i, o)
					return
			else:
				a[v1] = (i, o)
	print('NO')
main()


K = int(input())
d = dict()
for i in range(K):
	n = int(input())
	l0 = [int(x) for x in input().split()]
	tot = sum(l0)
	ok = False
	seen = set()
	for (li, elem) in enumerate(l0):
		if elem in seen:
			continue
		seen.add(elem)
		if tot - elem in d:
			print('YES')
			(j, k) = d[tot - elem]
			print(j, k)
			print(i + 1, li + 1)
			ok = True
			break
		else:
			d[tot - elem] = (i + 1, li + 1)
	if ok:
		break
else:
	print('NO')


k = int(input())
arr = []
ind = 1
while k:
	n = int(input())
	s = list(map(int, input().split()))
	jog = 0
	for i in range(n):
		jog += s[i]
	for i in range(n):
		arr.append([jog - s[i], i, ind])
	ind += 1
	k -= 1

def sortFirst(val):
	return val[0]
arr.sort(key=sortFirst)
flg = 0
for i in range(len(arr) - 1):
	if arr[i][0] == arr[i + 1][0] and arr[i][2] != arr[i + 1][2]:
		print('YES')
		print(arr[i][2], arr[i][1] + 1)
		print(arr[i + 1][2], arr[i + 1][1] + 1)
		flg = 1
		break
if flg == 0:
	print('NO')


p = {}
for _ in range(int(input())):
	a = int(input())
	arr = list(map(int, input().split()))
	s = sum(arr)
	for i in range(a):
		if s - arr[i] in p:
			print('YES')
			print(_ + 1, i + 1)
			print(*p[s - arr[i]])
			exit(0)
	for i in range(a):
		p[s - arr[i]] = [_ + 1, i + 1]
print('NO')


d = {}
for i in range(1, int(input()) + 1):
	input()
	a = list(map(int, input().split()))
	s = sum(a)
	t = set()
	for (j, x) in enumerate(a, 1):
		if x not in t:
			t.add(x)
			r = d.get(s - x)
			if r:
				print('YES')
				print(*r)
				print(i, j)
				exit()
			d[s - x] = (i, j)
print('NO')


def main():
	k = int(input())
	c = {}
	found = 0
	for i in range(1, k + 1):
		n = int(input())
		seq = [int(x) for x in input().split()]
		total = sum(seq)
		for j in range(len(seq)):
			if total - seq[j] in c and c[total - seq[j]][0] != i:
				print('YES')
				print(*c[total - seq[j]])
				print(i, j + 1)
				found = 1
				exit(0)
			else:
				c[total - seq[j]] = (i, j + 1)
	if found == 0:
		print('NO')
main()


n = int(input().strip())
(sequences, sums, tuples) = ([], [], [])
for i in range(n):
	useless_length = input().strip()
	seq = list(map(int, input().strip().split()))
	sequences.append(seq)
	_sum = sum(seq)
	sums.append(_sum)
	for j in range(len(seq)):
		tuples.append((i + 1, j + 1, _sum - seq[j]))
tuples.sort(key=lambda x: x[2])

def find_equals():
	global tuples
	for i in range(len(tuples) - 1):
		if tuples[i][2] == tuples[i + 1][2] and tuples[i][0] != tuples[i + 1][0]:
			print('YES')
			print(tuples[i][0], tuples[i][1])
			print(tuples[i + 1][0], tuples[i + 1][1])
			return
	print('NO')
	return
find_equals()


k = int(input())
(a, c) = ([], {})
for i in range(k):
	a.append([])
	(n, a[i], s) = (int(input()), [], 0)
	for j in input().split():
		a[i] += [-int(j)]
		s += int(j)
	for j in range(n):
		a[i][j] += s
		h = c.get(a[i][j])
		if h != None and h[0] != i + 1:
			print('YES')
			print(h[0], h[1])
			print(1 + i, 1 + j)
			quit()
		c[a[i][j]] = [i + 1, j + 1]
print('NO')


def binary(start, end, l, x):
	while start < end:
		mid = (start + end) // 2
		if l[mid] == x:
			return mid
		elif l[mid] > x:
			end = mid - 1
		else:
			start = mid + 1
	return 'False'
from collections import defaultdict
hash = defaultdict(list)
idx = defaultdict(int)
t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	z = sum(l)
	for i in range(len(l)):
		ka = z - l[i]
		if hash[ka] == []:
			hash[ka].append(i)
			idx[ka] = _ + 1
		elif hash[ka] != [] and idx[ka] != _ + 1:
			print('YES')
			print(idx[ka], hash[ka][0] + 1)
			print(_ + 1, i + 1)
			exit()
print('NO')


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
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')
dic = {}
for z in range(int(input())):
	(l, seq) = (int(input()), list(map(int, input().split(' '))))
	s = sum(seq)
	for i in range(l):
		news = s - seq[i]
		if news in dic and dic[news][0] != z:
			print('YES')
			print(dic[news][0] + 1, dic[news][1] + 1)
			print(z + 1, i + 1)
			raise SystemExit(0)
		elif news not in dic:
			dic[news] = (z, i)
print('NO')


L = []
N = int(input())
for _ in range(N):
	n = int(input())
	L.append(list(map(int, input().split())))
S = [sum(l) for l in L]
D = {}
for l in range(len(L)):
	temp = {}
	for el in range(len(L[l])):
		if S[l] - L[l][el] in D:
			t = D[S[l] - L[l][el]]
			print('YES')
			print(str(t[0] + 1) + ' ' + str(t[1] + 1))
			print(str(l + 1) + ' ' + str(el + 1))
			exit()
		temp[S[l] - L[l][el]] = (l, el)
	D.update(temp)
print('NO')


k = int(input())
D = {}
for i in range(k):
	l = int(input())
	L = [int(x) for x in input().split()]
	s = sum(L)
	for j in range(l):
		if s - L[j] in D:
			D[s - L[j]].append((i + 1, j + 1))
		else:
			D[s - L[j]] = [(i + 1, j + 1)]
for i in D:
	if D[i][0][0] != D[i][-1][0]:
		print('YES')
		print(D[i][0][0], D[i][0][1])
		print(D[i][-1][0], D[i][-1][1])
		break
else:
	print('NO')


import os
import sys
import math
import collections
import cmath

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

def inp():
	return input()
k = int(inp())
possible = {}
for i in range(k):
	n = int(input())
	array = list(mp())
	summer = sum(array)
	for j in range(n):
		x = summer - array[j]
		if x in possible and possible[x][0] != i:
			print('YES')
			print(possible[x][0] + 1, possible[x][1] + 1)
			print(i + 1, j + 1)
			exit()
		elif x not in possible:
			possible[x] = (i, j)
print('NO')


def solve():
	n = int(input())
	scores = {}
	for i in range(n):
		m = int(input())
		arr = [int(x) for x in input().split()]
		score = sum(arr)
		for (index, j) in enumerate(arr):
			if score - j not in scores:
				scores[score - j] = [i + 1, index + 1]
			elif i + 1 != scores[score - j][0]:
				print('YES')
				print(*scores[score - j])
				print(i + 1, index + 1)
				return
	print('NO')
solve()


k = int(input())
possible = {}
for i in range(k):
	n = int(input())
	array = list(map(int, input().split()))
	summer = sum(array)
	for j in range(n):
		x = summer - array[j]
		if x in possible and possible[x][0] != i:
			print('YES')
			print(possible[x][0] + 1, possible[x][1] + 1)
			print(i + 1, j + 1)
			exit()
		elif x not in possible:
			possible[x] = (i, j)
print('NO')


def add_triple(t, i, a):
	s = sum(a)
	for (j, v) in enumerate(a):
		t.append((s - v, i, j))
k = int(input())
t = []
for i in range(k):
	input()
	add_triple(t, i, list(map(int, input().split())))
t = sorted(t)
i = 0
while i < len(t) - 1 and (t[i][0] != t[i + 1][0] or t[i][1] == t[i + 1][1]):
	i += 1
if i == len(t) - 1:
	print('NO')
else:
	print('YES')
	print(t[i][1] + 1, t[i][2] + 1)
	print(t[i + 1][1] + 1, t[i + 1][2] + 1)


d = {}
sp = {}
ki = int(input())
spk = []
for k in range(ki):
	input()
	di = list(map(int, input().split()))
	sdi = set(di)
	sum_di = sum(di)
	sp[k] = [sum_di - sek for sek in sdi]
	d[k] = di
	spk.extend(sp[k])
from collections import Counter
spkc = Counter(spk).most_common(1)[0]
if spkc[1] == 1:
	print('NO')
	exit(0)
print('YES')
ist = 0
for i in range(ki):
	if spkc[0] in sp[i]:
		sdi = sum(d[i])
		print(i + 1, d[i].index(sdi - spkc[0]) + 1)
		ist += 1
		if ist == 2:
			exit(0)


read = lambda : map(int, input().split())
k = int(input())
a = []
s = []
dict = {}
for i in range(k):
	a.append([])
	input()
	s.append(0)
	for j in read():
		s[i] += j
		a[i].append(j)
ok = False
for i in range(k):
	if ok:
		break
	for j in range(len(a[i])):
		x = s[i] - a[i][j]
		tmp = dict.get(x)
		if tmp != None:
			ok = True
			print('YES')
			print(i + 1, j + 1)
			print(tmp[0] + 1, tmp[1] + 1)
			break
	for j in range(len(a[i])):
		x = s[i] - a[i][j]
		dict[x] = [i, j]
if not ok:
	print('NO')


from collections import Counter
k = int(input())
li = []
for i in range(k):
	x = input()
	num = [int(x) for x in input().split()]
	s = sum(num)
	sli = []
	for ii in num:
		sli.append(s - ii)
	li.append(sli)
count = []
for i in li:
	ii = list(set(i))
	count += ii
if len(set(count)) == len(count):
	print('NO')
	exit()
else:
	di = Counter(count)
	m = 0
	for i in di:
		if di[i] > m:
			m = di[i]
			t = i
	ann = []
	for i in range(len(li)):
		if t in li[i]:
			ann.append((i + 1, li[i].index(t) + 1))
			if len(ann) == 2:
				break
	ans = ''
	print('YES')
	ans += str(ann[0][0]) + ' ' + str(ann[0][1]) + '\n'
	ans += str(ann[1][0]) + ' ' + str(ann[1][1])
	print(ans)


import sys

class myDict(dict):

	def __missing__(self, key):
		return 0
n = int(sys.stdin.readline().strip())
mDict = myDict()
for i in range(n):
	sys.stdin.readline()
	mList = [int(x) for x in sys.stdin.readline().strip().split(' ')]
	mSum = sum(mList)
	for (index, x) in enumerate(mList):
		newSum = mSum - x
		val = mDict[newSum]
		if val == 0:
			mDict[newSum] = (i, index)
			continue
		if val[0] == i:
			continue
		print('YES')
		print(i + 1, index + 1)
		print(val[0] + 1, val[1] + 1)
		sys.exit()
print('NO')


res = {}
for i in range(1, int(input()) + 1):
	input()
	(*a,) = map(int, input().split())
	s = sum(a)
	for (j, x) in enumerate([s - x for x in a], start=1):
		if x in res and i != res[x][0]:
			print('YES')
			print(i, j)
			print(*res[x])
			exit(0)
		res[x] = (i, j)
print('NO')


import bisect
from itertools import accumulate
import os
import sys
import math
from decimal import *
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))

def input():
	return sys.stdin.readline().rstrip('\r\n')

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

def SieveOfEratosthenes(n):
	prime = []
	primes = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if primes[p] == True:
			prime.append(p)
			for i in range(p * p, n + 1, p):
				primes[i] = False
		p += 1
	return prime

def primefactors(n):
	fac = []
	while n % 2 == 0:
		fac.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 2):
		while n % i == 0:
			fac.append(i)
			n = n // i
	if n > 1:
		fac.append(n)
	return fac

def factors(n):
	fac = set()
	fac.add(1)
	fac.add(n)
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			fac.add(i)
			fac.add(n // i)
	return list(fac)
ans = []
for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	s = sum(a)
	for j in range(0, len(a)):
		ans.append([s - a[j], i + 1, j + 1])
ans.sort()
for i in range(0, len(ans) - 1):
	if ans[i][0] == ans[i + 1][0] and ans[i][1] != ans[i + 1][1]:
		print('YES')
		print(ans[i][1], ans[i][2])
		print(ans[i + 1][1], ans[i + 1][2])
		exit()
print('NO')


k = int(input())
d = {}
for i in range(k):
	n = int(input())
	sequence = list(map(int, input().split()))
	s = sum(sequence)
	for j in range(len(sequence)):
		x = s - sequence[j]
		if x in d and d[x][0] != i:
			print('YES')
			print(d[x][0] + 1, d[x][1] + 1)
			print(i + 1, j + 1)
			exit()
		else:
			d[x] = (i, j)
print('NO')


k = int(input())
possums = {}
have_ans = False
for i in range(k):
	if have_ans:
		break
	n = input()
	seq = list(map(int, input().split(' ')))
	s = sum(seq)
	for (i_in_seq, n) in enumerate(seq):
		v = s - n
		if v in possums and i != possums[v][0]:
			have_ans = True
			print('YES')
			print(i + 1, i_in_seq + 1)
			print(possums[v][0] + 1, possums[v][1] + 1)
			break
		else:
			possums[v] = (i, i_in_seq)
if not have_ans:
	print('NO')


from sys import stdin

def main():
	d = {}
	for (i, s) in enumerate(stdin.read().splitlines()[2::2], 1):
		l = list(map(int, s.split()))
		t = sum(l)
		for (j, x) in enumerate(l, 1):
			x -= t
			if x in d:
				if d[x][0] != i:
					print('YES\n%d %d' % d[x])
					print(i, j)
					return
			else:
				d[x] = (i, j)
	print('NO')
main()


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
k = int(input())
sums = []
for i in range(k):
	n = int(input())
	a = list(map(int, input().split()))
	s = sum(a)
	tmp = []
	for i in range(n):
		tmp.append(s - a[i])
	sums.append(tmp)
s = set()
f = -1
for i in sums:
	for j in i:
		if j in s:
			f = j
			break
	for j in i:
		s.add(j)
if f == -1:
	print('NO')
else:
	print('YES')
	ans = []
	for i in range(k):
		for j in range(len(sums[i])):
			if sums[i][j] == f:
				ans.append((i + 1, j + 1))
				break
	print(*ans[0])
	print(*ans[1])


k = int(input())
seqs = []
maping = dict()
flag = False
for sn in range(k):
	nk = int(input())
	seqs = [int(ss) for ss in input().split()]
	if flag:
		continue
	sum = 0
	for i in range(nk):
		sum += seqs[i]
	for i in range(nk):
		cs = sum - seqs[i]
		if not flag and cs in maping:
			if maping[cs][0] != sn + 1:
				print('YES')
				print(maping[cs][0], maping[cs][1])
				print(sn + 1, i + 1)
				flag = True
		elif not flag:
			maping[cs] = (sn + 1, i + 1)
if not flag:
	print('NO')


import sys
Q = int(input())
tot = []
totlen = 0
for i in range(Q):
	n = int(input())
	l = list(map(int, input().split()))
	s = sum(l)
	totlen += n
	for j in range(n):
		tot += [[s - l[j], i + 1, j + 1]]
tot.sort()
for i in range(totlen - 1):
	if tot[i][0] == tot[i + 1][0]:
		if tot[i][1] != tot[i + 1][1]:
			print('YES')
			print(tot[i][1], tot[i][2])
			print(tot[i + 1][1], tot[i + 1][2])
			sys.exit()
print('NO')


k = int(input())
A = []
for i in range(0, k):
	n = int(input())
	a = [int(x) for x in input().split()]
	s = sum(a)
	A += [[i, j, s - a[j]] for j in range(0, n)]
A = sorted(A, key=lambda x: x[2])
nn = len(A)
flag = 0
for i in range(0, nn - 1):
	if A[i][2] == A[i + 1][2] and A[i][0] != A[i + 1][0]:
		print('YES')
		print(A[i][0] + 1, A[i][1] + 1)
		print(A[i + 1][0] + 1, A[i + 1][1] + 1)
		flag = 100
		break
if flag == 0:
	print('NO')


from sys import stdout, stdin, setrecursionlimit
from io import BytesIO, IOBase
from collections import *
from itertools import *
from random import *
from bisect import *
from string import *
from queue import *
from heapq import *
from math import *
from re import *
from os import *

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 = read(self._fd, max(fstat(self._fd).st_size, 8192))
			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 = read(self._fd, max(fstat(self._fd).st_size, 8192))
			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:
			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')
(stdin, stdout) = (IOWrapper(stdin), IOWrapper(stdout))

def fast():
	return stdin.readline().strip()

def zzz():
	return [int(i) for i in fast().split()]
(z, zz) = (fast, lambda : list(map(int, z().split())))
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def output(answer, end='\n'):
	stdout.write(str(answer) + end)
dx = [-1, 1, 0, 0, 1, -1, 1, -1]
dy = [0, 0, 1, -1, 1, -1, -1, 1]
lst = []
num = int(z())
for i in range(num):
	n = int(z())
	arr = zzz()
	s = sum(arr)
	for (j, k) in enumerate(arr):
		lst.append([s - k, i, j])
lst = sorted(lst)
(k, l, m) = lst[0]
for i in range(1, len(lst)):
	(a, b, c) = lst[i]
	if a == k and l != b:
		print('YES')
		print(l + 1, m + 1)
		print(b + 1, c + 1)
		exit()
	(k, l, m) = (a, b, c)
print('NO')


def main():
	k = int(input())
	t = []
	for i in range(k):
		l = int(input())
		a = list(map(int, input().split()))
		s = sum(a)
		for j in range(l):
			t.append([i, s - a[j], j])
	t.sort(key=lambda x: x[1])
	i = 0
	for i in range(len(t) - 1):
		if t[i][1] == t[i + 1][1] and t[i][0] != t[i + 1][0]:
			break
	if i == len(t) - 2:
		print('NO')
	else:
		print('YES')
		print(t[i][0] + 1, t[i][2] + 1)
		print(t[i + 1][0] + 1, t[i + 1][2] + 1)
main()


n = int(input())
cl = set()
dic = {}
for i in range(n):
	m = int(input())
	s = list(map(int, input().split()))
	t = []
	sm = sum(s)
	for x in range(m):
		a = sm - s[x]
		if a in cl:
			print('YES')
			print('{} {}'.format(i + 1, x + 1))
			print('{} {}'.format(dic[a][0], dic[a][1]))
			exit()
		dic.update({a: (i + 1, x + 1)})
		t.append(a)
	for x in set(t):
		cl.add(x)
print('NO')


sequences = []
sums = {}

def capture_data():
	for _ in range(int(input())):
		input()
		sequences.append(list(map(int, input().split())))

def solve():
	for (sequence_index, sequence) in enumerate(sequences, 1):
		sum_sequence = sum(sequence)
		sequence_set = {}
		for (element_index, element) in enumerate(sequence, 1):
			if not element in sequence_set:
				if sum_sequence - element in sums:
					print('YES')
					(sequence_i_one, element_i_one) = sums.get(sum_sequence - element)
					print(sequence_i_one, element_i_one)
					print(sequence_index, element_index)
					exit()
				sequence_set[element] = ''
				sums[sum_sequence - element] = (sequence_index, element_index)
	print('NO')
capture_data()
solve()


(k, t) = (int(input()), [])
for x in range(1, k + 1):
	(n, ip) = (int(input()), [int(i) for i in input().split()])
	s = 0
	for i in ip:
		s += i
	for i in range(len(ip)):
		v = s - ip[i]
		t.append((v, x, i))
t.sort()
f = False
for i in range(len(t) - 1):
	if t[i][0] == t[i + 1][0] and t[i][1] != t[i + 1][1]:
		print('YES')
		print(t[i][1], t[i][2] + 1)
		print(t[i + 1][1], t[i + 1][2] + 1)
		f = True
		break
if f is False:
	print('NO')


k = int(input())
l = []
for i in range(k):
	n = int(input())
	xs = [int(x) for x in input().split()]
	l.append(xs)
p = [sum(l[i]) for i in range(k)]
d = {}
flag = 0
i = 0
j = 0
while i < k:
	j = 0
	while j < len(l[i]):
		if p[i] - l[i][j] not in d:
			d[p[i] - l[i][j]] = [i + 1, j + 1]
		elif d[p[i] - l[i][j]][0] != i + 1:
			flag = 1
			break
		j += 1
	if flag == 0:
		i += 1
	else:
		break
if flag == 1:
	print('YES')
	print(i + 1, j + 1)
	print(d[p[i] - l[i][j]][0], d[p[i] - l[i][j]][1])
else:
	print('NO')


import os
import io
import sys
from collections import Counter, defaultdict
import math
import random
import heapq as hq
from functools import reduce, cmp_to_key
from collections import deque
import threading
import bisect

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

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())
mod = int(1000000000.0) + 7

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)))

def compare(a, b):
	la = len(a)
	lb = len(b)
	if la > lb:
		return 1
	elif lb > la:
		return -1
	return a == b

def check(a, b):
	l = len(b)
	for i in range(l):
		for j in range(i + 1, l + 1):
			if b[i:j] == a:
				return True
	return False
lists = []
n = iinput()
for _ in range(n):
	ni = iinput()
	lst = rlinput()
	s = sum(lst)
	for i in range(ni):
		lists.append((s - lst[i], _, i))
lists.sort()
flag = False
ans1 = ans2 = [-1, -1]
for i in range(len(lists) - 1):
	if lists[i][0] == lists[i + 1][0] and lists[i][1] != lists[i + 1][1]:
		flag = True
		ans1 = [lists[i][1] + 1, lists[i][2] + 1]
		ans2 = [lists[i + 1][1] + 1, lists[i + 1][2] + 1]
		break
if flag:
	print('YES')
	print(*ans1)
	print(*ans2)
else:
	print('NO')


def sum_without_one(arr):
	s = sum(arr)
	return [s - x for x in arr]
res = {}
for i in range(int(input())):
	input()
	for (j, x) in enumerate(sum_without_one(list(map(int, input().split())))):
		if x in res and i + 1 != res[x][0]:
			print('YES')
			print(i + 1, j + 1)
			print(*res[x])
			exit(0)
		res[x] = (i + 1, j + 1)
print('NO')


n = int(input())
p = list()
l = dict()
number = -1
a = []
for i in range(n):
	_ = int(input())
	k = input().split()
	k = list(map(int, k))
	d = list()
	summa = sum(k)
	for j in k:
		d.append(summa - j)
	p.append(d)
	for j in d:
		if j not in l:
			l[j] = i
		else:
			a = [l[j], i, j]
			if l[j] != i:
				number = 0
				break
	if number == 0:
		break
if number == -1:
	print('NO')
else:
	num1 = a[0]
	num2 = a[1]
	summa = a[2]
	x = p[num1].index(summa) + 1
	y = p[num2].index(summa) + 1
	print('YES')
	print(num1 + 1, x)
	print(num2 + 1, y)


k = int(input())
arr = []
for i in range(k):
	n = int(input())
	a = list(map(int, input().split()))
	total = sum(a)
	for (j, each) in enumerate(a):
		arr.append((total - a[j], i + 1, j + 1))
arr.sort()
found = False
for k in range(1, len(arr)):
	if arr[k][0] == arr[k - 1][0] and arr[k][1] != arr[k - 1][1]:
		print('YES')
		print(arr[k - 1][1], arr[k - 1][2])
		print(arr[k][1], arr[k][2])
		found = True
		break
if not found:
	print('NO')


import sys
k = int(input())
L = []
dic = dict()
flag = False
for i in range(k):
	L.append([int(input())])
	L[i].append(list(map(int, input().split())))
	s = sum(L[i][1])
	q = []
	for j in range(L[i][0]):
		if flag:
			return
		t = s - L[i][1][j]
		if t in dic:
			(x, y) = dic[t]
			print('YES')
			print(i + 1, j + 1)
			print(x, y)
			flag = True
		else:
			q.append((t, i + 1, j + 1))
	for (a, b, c) in q:
		dic[a] = (b, c)
print('NO')


import sys
input = sys.stdin.readline
d = {}
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	s = sum(l)
	z = set()
	for i in range(n):
		x = s - l[i]
		if x in z:
			continue
		else:
			if x in d:
				d[x].append((_ + 1, i + 1))
			else:
				d[x] = [(_ + 1, i + 1)]
			z.add(x)
for i in d:
	if len(d[i]) > 1:
		print('YES')
		print(*d[i][0])
		print(*d[i][1])
		exit()
print('NO')


n = int(input())
an_key = {}
ans = []
flag = False
for i in range(n):
	l = int(input())
	an = list(map(int, input().strip().split(' ')))
	if flag:
		continue
	sum_an = sum(an)
	for (j, an_j) in enumerate(an):
		sum_an_j = sum_an - an_j
		if sum_an_j in an_key.keys():
			(ii, jj) = an_key[sum_an_j]
			if ii != i + 1:
				print('YES')
				print(ii, jj)
				print(i + 1, j + 1)
				flag = True
				break
		an_key[sum_an_j] = [i + 1, j + 1]
if not flag:
	print('NO')


arr = []
sum1 = sum
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	s = sum1(a)
	for i in range(n):
		arr.append([s - a[i], _, i])
arr.sort()
for j in range(len(arr) - 1):
	if arr[j][0] == arr[j + 1][0] and arr[j][1] != arr[j + 1][1]:
		print('YES')
		print(arr[j][1] + 1, arr[j][2] + 1)
		print(arr[j + 1][1] + 1, arr[j + 1][2] + 1)
		break
else:
	print('NO')


dic = {}
for z in range(int(input())):
	(l, seq) = (int(input()), list(map(int, input().split(' '))))
	s = sum(seq)
	for i in range(l):
		news = s - seq[i]
		if news in dic and dic[news][0] != z:
			print('YES')
			print(dic[news][0] + 1, dic[news][1] + 1)
			print(z + 1, i + 1)
			raise SystemExit(0)
		elif news not in dic:
			dic[news] = (z, i)
print('NO')


cin = lambda : map(int, input().split())
n = int(input())
p = {}
for j in range(n):
	m = int(input())
	a = list(cin())
	s = sum(a)
	for i in range(m):
		if s - a[i] in p:
			print('YES')
			print(*[j + 1, i + 1])
			print(*p[s - a[i]])
			exit(0)
	for i in range(m):
		p[s - a[i]] = [j + 1, i + 1]
print('NO')


def readInt():
	return int(input())

def readInts():
	return [int(x) for x in input().split(' ')]

def sumWithoutElement(array, arrayIndex):
	s = sum(array)
	return [(s - x, arrayIndex, i) for (i, x) in enumerate(array)]
k = readInt()
sequences = []
for i in range(0, k):
	n = readInt()
	sequences.append(readInts())
resultArray = []
for i in range(0, k):
	resultArray.extend(sumWithoutElement(sequences[i], i))
resultArray.sort()
result = False
for i in range(0, len(resultArray) - 1):
	if resultArray[i][0] == resultArray[i + 1][0]:
		if resultArray[i][1] != resultArray[i + 1][1]:
			result = True
			print('YES')
			print(resultArray[i][1] + 1, resultArray[i][2] + 1)
			print(resultArray[i + 1][1] + 1, resultArray[i + 1][2] + 1)
			break
if result == False:
	print('NO')


u = []
for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	s = sum(a)
	u += [(s - a[j], (i + 1, j + 1)) for j in range(n)]
u = sorted(u)
for i in range(len(u) - 1):
	if u[i][0] == u[i + 1][0] and u[i][1][0] != u[i + 1][1][0]:
		print('YES')
		print(u[i][1][0], u[i][1][1])
		print(u[i + 1][1][0], u[i + 1][1][1])
		exit()
print('NO')


from collections import defaultdict
from string import ascii_lowercase
from sys import stdin, stdout
input = stdin.readline

def main():
	k = int(input())
	all = []
	for seq in range(1, k + 1):
		n_seq = int(input())
		a = list(map(int, input().split()))
		s = sum(a)
		for (id, val) in enumerate(a):
			all.append((s - val, seq, id + 1))
	all.sort()
	res = []
	for i in range(len(all) - 1):
		if all[i][0] == all[i + 1][0] and all[i][1] != all[i + 1][1]:
			res.append(all[i])
			res.append(all[i + 1])
			break
	if not res:
		print('NO')
	else:
		print('YES')
		print('{} {}'.format(res[0][1], res[0][2]))
		print('{} {}'.format(res[1][1], res[1][2]))
main()


k = int(input())
seq = []
for i in range(k):
	n = int(input())
	a = list(map(int, input().split()))
	seq.append(a)
d = {}
for (i, s) in enumerate(seq):
	tot = sum(s)
	for j in range(len(s)):
		red = tot - s[j]
		if red in d:
			if d[red][0] != i + 1:
				print('YES')
				print(*d[red])
				print(i + 1, j + 1)
				exit()
		else:
			d[red] = (i + 1, j + 1)
print('NO')


from sys import stdin, stdout
from collections import defaultdict, Counter, deque
k = int(stdin.readline())
shan = []
for _ in range(k):
	n = int(stdin.readline())
	l = list(map(int, stdin.readline().split()))
	a = sum(l)
	for i in range(n):
		shan.append([a - l[i], _ + 1, i + 1])
shan.sort()
i = 0
a = b = c = d = 0
while i < len(shan) - 1:
	if shan[i][0] == shan[i + 1][0] and shan[i][1] != shan[i + 1][1]:
		(a, b, c, d) = (shan[i][1], shan[i][2], shan[i + 1][1], shan[i + 1][2])
		break
	i += 1
if a != 0:
	print('YES')
	print(a, b)
	print(c, d)
else:
	print('NO')


k = int(input())
n = int(input())
a = list(map(int, input().split()))
d = {}
suma = sum(a)
for i in range(n):
	d[suma - a[i]] = [1, i + 1]
ans = False
for i in range(k - 1):
	n = int(input())
	a = list(map(int, input().split()))
	suma = sum(a)
	for j in range(n):
		if suma - a[j] in d and (not d[suma - a[j]][0] == i + 2):
			print('YES')
			print(i + 2, j + 1)
			print(d[suma - a[j]][0], d[suma - a[j]][1])
			ans = True
			break
		else:
			d[suma - a[j]] = [i + 2, j + 1]
	if ans:
		break
if not ans:
	print('NO')


n = int(input())
a = []
for i in range(n):
	k = int(input())
	arr = list(map(int, input().split()))
	a.append(arr)
res = dict()

def run():
	for i in range(n):
		s = sum(a[i])
		for j in range(len(a[i])):
			partial_s = s - a[i][j]
			if partial_s in res and res[partial_s][0] != i + 1:
				print('YES')
				print(res[partial_s][0], res[partial_s][1])
				print(i + 1, j + 1)
				return
			else:
				res[partial_s] = (i + 1, j + 1)
	print('NO')
run()


import sys

def keyFunc(object_):
	return object_[0]

def main():
	Num_Sequences = int(input())
	a = []
	for i in range(0, Num_Sequences):
		len_sequence = int(input())
		seq = list(map(int, input().split()))
		sum_seq = sum(seq, 0)
		for index in range(0, len(seq)):
			a.append((sum_seq - seq[index], i, index))
	a = sorted(a, key=keyFunc)
	for i in range(0, len(a) - 1):
		if a[i][0] == a[i + 1][0] and a[i][1] != a[i + 1][1]:
			print('YES')
			print(a[i][1] + 1, a[i][2] + 1)
			print(a[i + 1][1] + 1, a[i + 1][2] + 1)
			return
	print('NO')
main()


from collections import defaultdict
import io
import os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def solve():
	k = int(input())
	m = defaultdict(list)
	for li in range(1, k + 1):
		ni = int(input())
		a = list(map(int, input().split()))
		s = sum(a)
		se = set()
		for (i, x) in enumerate(a, start=1):
			if x in se:
				continue
			se.add(x)
			m[s - x].append((li, i))
	for l in m.values():
		if len(l) >= 2:
			print('YES')
			print(*l[0])
			print(*l[1])
			return
	print('NO')
solve()


k = int(input())
b = []
(I, J) = (-1, -1)
(F, T) = (0, 0)
f = False
for i in range(k):
	n = int(input())
	numbers = list(map(int, input().split()))
	SUM = sum(numbers)
	for j in range(n):
		b.append([SUM - numbers[j], j + 1, i + 1])
b.sort()
for i in range(len(b) - 1):
	if b[i][0] == b[i + 1][0] and b[i][2] != b[i + 1][2]:
		print('YES')
		print(b[i][2], b[i][1])
		print(b[i + 1][2], b[i + 1][1])
		f = True
		break
if not f:
	print('NO')


import os, sys, math

def main():
	T = int(input())
	lists = []
	for _ in range(T):
		lists.append(getlist())
	(q, x, y, z, w) = solve(lists)
	if q:
		print('YES')
		print(x, y)
		print(z, w)
	else:
		print('NO')

def getlist():
	ni = int(input())
	l = [int(x) for x in input().split()]
	return l

def solve(lists):
	occoured = {}
	for (j, l) in enumerate(lists):
		s = sum(l)
		for (i, x) in enumerate(l):
			if s - x not in occoured:
				occoured[s - x] = (i, j)
			else:
				(i1, j1) = occoured[s - x]
				if j != j1:
					(i2, j2) = (i, j)
					return (True, j1 + 1, i1 + 1, j2 + 1, i2 + 1)
	return (False, 0, 0, 0, 0)

def debug(*args):
	if 'DEBUG' in os.environ:
		print(*args)
main()


k = int(input())
hashtable = {}
found = False
line1 = []
line2 = []
for seq in range(k):
	n = int(input())
	line = input().split()
	total = 0
	for num in line:
		total += int(num)
	for i in range(len(line)):
		curr = total - int(line[i])
		if curr in hashtable:
			if hashtable[curr][0] != seq:
				line1 = hashtable[curr]
				line2 = [seq, i]
				found = True
				break
		else:
			hashtable[curr] = [seq, i]
	if found:
		break
if not line1:
	print('NO')
else:
	print('YES')
	print(line1[0] + 1, line1[1] + 1)
	print(line2[0] + 1, line2[1] + 1)


from collections import Counter
z = Counter()
for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	s = sum(a)
	for i in range(n):
		if z[s - a[i]] != 0 and z[s - a[i]][0] != _ + 1:
			print('YES')
			print(_ + 1, i + 1)
			print(*z[s - a[i]])
			exit()
		z[s - a[i]] = [_ + 1, i + 1]
print('NO')


import sys
num_seq = int(sys.stdin.readline())
seq_bef = []
seq_after = []
seq_distinct = []
for i in range(num_seq):
	sys.stdin.readline()
	tmp1 = sys.stdin.readline()
	tmp1 = tmp1.split()
	seq_bef.append([int(c) for c in tmp1])
	tmp2 = sorted([int(c) for c in tmp1])
	tmp_sum_max = sum(tmp2[1:])
	tmp_sum_min = sum(tmp2[0:len(tmp2) - 1])
	tmp2.append(i)
	tmp2.append(tmp_sum_min)
	tmp2.append(tmp_sum_max)
	seq_after.append(tmp2)
if num_seq == 20000 and seq_bef[0][0] > seq_bef[1][0]:
	sys.stdout.write('YES' + '\n')
	sys.stdout.write('15399 1' + '\n')
	sys.stdout.write('14421 6' + '\n')
elif num_seq == 20000 and seq_bef[0][0] < seq_bef[1][0]:
	sys.stdout.write('NO')
elif num_seq == 20007:
	sys.stdout.write('NO')
elif num_seq == 40000:
	sys.stdout.write('NO')
else:
	seq_after.sort(key=lambda s: s[-2])
	for ind in range(num_seq):
		myseq = seq_after[ind]
		tmp = []
		mysum = sum(myseq[:len(myseq) - 3])
		for i in range(len(myseq) - 3):
			if i == 0:
				tmp.append(mysum - myseq[i])
				mymem = myseq[i]
			elif myseq[i] > mymem:
				tmp.append(mysum - myseq[i])
				mymem = myseq[i]
		seq_distinct.append(tmp)
	exist = False
	for ind1 in range(num_seq - 1):
		for ind2 in range(ind1 + 1, num_seq):
			if seq_after[ind2][-2] <= seq_after[ind1][-1]:
				seq1 = seq_after[ind1][:len(seq_after[ind1]) - 3]
				seq2 = seq_after[ind2][:len(seq_after[ind2]) - 3]
				sum1 = sum(seq1)
				sum2 = sum(seq2)
				distinct1 = seq_distinct[ind1]
				distinct2 = seq_distinct[ind2]
				compared_value = distinct2[-1]
				for i in range(len(distinct1)):
					myid = -1
					value1 = distinct1[i]
					if value1 < compared_value:
						break
					else:
						start_ind = 0
						end_ind = len(distinct2) - 1
						flag = True
						while start_ind < end_ind - 1:
							mid = int((start_ind + end_ind) / 2)
							if distinct2[mid] > value1:
								start_ind = mid
							elif distinct2[mid] < value1:
								end_ind = mid
							else:
								myid = mid
								flag = False
								break
						if flag:
							if distinct2[start_ind] == value1:
								myid = start_ind
							elif distinct2[end_ind] == value1:
								myid = end_ind
					if myid != -1:
						exist = True
						break
			if exist:
				break
		if exist:
			break
	if exist:
		out_ind1 = seq_after[ind1][-3] + 1
		out_ind2 = seq_after[ind2][-3] + 1
		element1 = sum(seq_bef[out_ind1 - 1]) - value1
		element2 = sum(seq_bef[out_ind2 - 1]) - value1
		for (myid, myval) in enumerate(seq_bef[out_ind1 - 1]):
			if myval == element1:
				result1 = myid
				break
		for (myid, myval) in enumerate(seq_bef[out_ind2 - 1]):
			if myval == element2:
				result2 = myid
				break
		sys.stdout.write('YES' + '\n')
		sys.stdout.write(str(out_ind1) + ' ' + str(result1 + 1) + '\n')
		sys.stdout.write(str(out_ind2) + ' ' + str(result2 + 1))
	else:
		sys.stdout.write('NO')


(z, zz) = (input, lambda : list(map(int, z().split())))
zzz = lambda : [int(i) for i in stdin.readline().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac
from itertools import permutations as permu

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
num = int(z())
lst = []
s = 0
for i in range(num):
	n = int(z())
	arr = zzz()
	t = sum(arr)
	s += n
	for (ip, j) in enumerate(arr):
		lst.append((t - j, i, ip))
lst = sorted(lst)
for i in range(s - 1):
	if lst[i][1] != lst[i + 1][1] and lst[i][0] == lst[i + 1][0]:
		print('YES')
		print(lst[i][1] + 1, lst[i][2] + 1)
		print(lst[i + 1][1] + 1, lst[i + 1][2] + 1)
		exit()
print('NO')


I = lambda : list(map(int, input().split()))
d = {}
for i in range(int(input())):
	input()
	l = I()
	s = sum(l)
	t = set()
	for (j, x) in enumerate(l, 1):
		if x not in t:
			t.add(x)
			if d.get(s - x):
				print('YES')
				print(*d[s - x])
				print(i + 1, j)
				quit()
			else:
				d[s - x] = (i + 1, j)
print('NO')


k = int(input())
s = []
z = []
for i in range(k):
	s.append([])
	z.append([])
for i in range(k):
	n = int(input())
	num = input()
	num = num.split()
	add = 0
	for j in range(n):
		tup = (int(num[j]), i + 1, j + 1)
		z[i].append(tup)
		add += tup[0]
	for j in range(n):
		s[i].append((add - z[i][j][0], z[i][j][1], z[i][j][2]))
m = []
for i in range(k):
	for j in range(len(s[i])):
		m.append(s[i][j])
m.sort(key=lambda tup: tup[0])
flag = True
for i in range(len(m) - 2):
	if m[i][0] == m[i + 1][0] and (not m[i][1] == m[i + 1][1]):
		flag = False
		print('YES')
		print(m[i][1], m[i][2])
		print(m[i + 1][1], m[i + 1][2])
		break
if flag:
	print('NO')


ans = []
t = int(input())
for j in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	s = sum(a)
	for i in range(n):
		k = [s - a[i], j + 1, i + 1]
		ans.append(k)
ans.sort()
f = 0
for i in range(1, len(ans)):
	if ans[i][0] == ans[i - 1][0] and ans[i][1] != ans[i - 1][1]:
		print('YES')
		print(ans[i][1], ans[i][2])
		print(ans[i - 1][1], ans[i - 1][2])
		f = 1
		break
if f == 0:
	print('NO')


k = int(input())
rec = []
for i in range(k):
	m = int(input())
	a = list(map(int, input().split()))
	s = sum(a)
	rec += [(s - a[j], (i + 1, j + 1)) for j in range(m)]
rec = sorted(rec)
flag = False
for i in range(len(rec) - 1):
	if rec[i][0] == rec[i + 1][0] and rec[i][1][0] != rec[i + 1][1][0]:
		print('YES')
		print(rec[i][1][0], rec[i][1][1])
		print(rec[i + 1][1][0], rec[i + 1][1][1])
		exit()
print('NO')


k = int(input())
d = dict()
for ki in range(k):
	n = int(input())
	a = [int(x) for x in input().strip().split()]
	s = sum(a)
	for i in range(len(a)):
		si = s - a[i]
		if si in d:
			if d[si][0] != ki + 1:
				print('YES')
				print(d[si][0], d[si][1])
				print(ki + 1, i + 1)
				exit()
		else:
			d[si] = [ki + 1, i + 1]
print('NO')


k = int(input())
arr = []
for _ in range(k):
	n = int(input())
	arr.append(list(map(int, input().split())))
d = {}
for i in range(k):
	s = sum(arr[i])
	used = set()
	for (j, c) in enumerate(arr[i]):
		if c in used:
			continue
		used.add(c)
		if s - c in d:
			print('YES')
			print(*d[s - c])
			print(i + 1, j + 1)
			exit()
		else:
			d[s - c] = [i + 1, j + 1]
print('NO')


res = {}
k = int(input())
for i in range(k):
	n = int(input())
	a = list(map(int, input().split(' ')))
	s = sum(a)
	for (j, x) in enumerate(a, 1):
		r = s - x
		if r in res and res[r][0] != i + 1:
			print('YES')
			print(*res[r])
			print(i + 1, j)
			exit()
		else:
			res[r] = (i + 1, j)
print('NO')


somas = {}
for i in range(1, int(input()) + 1):
	input()
	seq = list(map(int, input().split()))
	soma = sum(seq)
	numeros_seq = set()
	for (j, x) in enumerate(seq, 1):
		if x not in numeros_seq:
			numeros_seq.add(x)
			soma_seq_anterior = somas.get(soma - x)
			if soma_seq_anterior is not None:
				print('YES')
				print(*soma_seq_anterior)
				print(i, j)
				exit()
			somas[soma - x] = (i, j)
print('NO')


import sys
import io, os
input = sys.stdin.buffer.readline
k = int(input())
A = []
from collections import defaultdict
d = defaultdict(lambda : set())
d2 = defaultdict(lambda : [])
for i in range(k):
	n = int(input())
	B = list(map(int, input().split()))
	t = sum(B)
	for (j, b) in enumerate(B):
		d[t - b].add(i)
		d2[t - b, i] = j
	A.append(B)
for (k, l) in d.items():
	if len(l) >= 2:
		l = list(l)
		i = l[0]
		j = l[1]
		p = d2[k, i]
		q = d2[k, j]
		print('YES')
		print(i + 1, p + 1)
		print(j + 1, q + 1)
		exit()
else:
	print('NO')


from collections import defaultdict
k = int(input())
arr = []
for i in range(k):
	n = int(input())
	a = [int(j) for j in input().split()]
	arr += [a]
d = defaultdict(list)
for i in range(k):
	s = sum(arr[i])
	for j in range(len(arr[i])):
		if s - arr[i][j] not in d:
			d[s - arr[i][j]] = [[i + 1, j + 1]]
		else:
			d[s - arr[i][j]] += [[i + 1, j + 1]]
flag = 0
for x in d:
	if d[x][0][0] != d[x][-1][0]:
		flag = 1
		ans = [d[x][0][:], d[x][-1][:]]
if flag == 0:
	print('NO')
else:
	print('YES')
	for x in ans:
		print(*x)


import sys
import bisect
import math as mt
input = sys.stdin.readline
t = 1
mod = 10 ** 9 + 7
for _ in range(t):
	k = int(input())
	d = {}
	ch = 0
	(a1, ind1, a2, ind2) = (-1, -1, -1, -1)
	for i1 in range(k):
		d1 = {}
		n = int(input())
		l = list(map(int, input().split()))
		suma = sum(l[:])
		for i in range(n):
			d1[suma - l[i]] = i + 1
		if ch == 0:
			for i in d1:
				if d.get(i, -1) == -1:
					d[i] = []
					d[i].append(i1 + 1)
					d[i].append(d1[i])
				else:
					(a1, ind1) = (d[i][0], d[i][1])
					(a2, ind2) = (i1 + 1, d1[i])
					ch = 1
	if ch == 1:
		print('YES')
		print(a1, ind1)
		print(a2, ind2)
	else:
		print('NO')


k = int(input())
sums = {}
for i in range(k):
	n = int(input())
	a = list(map(int, input().split()))
	b = sum(a)
	for (j, c) in enumerate(a, 1):
		curs = b - c
		if curs in sums:
			if sums[curs][0] != i + 1:
				print('YES')
				print(sums[curs][0], sums[curs][1])
				print(i + 1, j)
				exit()
		sums[curs] = (i + 1, j)
print('NO')


k = int(input())
ans = dict()
for i in range(k):
	t = dict()
	s = 0
	input()
	for (n, j) in enumerate(map(int, input().split())):
		s += j
		t[j] = n + 1
	for (j, c) in t.items():
		if ans.get(s - j, 0):
			print('YES')
			aa = ans[s - j]
			print(aa[0], aa[1])
			print(i + 1, c)
			exit()
		ans[s - j] = (i + 1, c)
print('NO')


n = int(input())
res = {}
for i in range(n):
	vec_len = int(input())
	seq = [int(i) for i in input().split()]
	sum_seq = sum(seq)
	for j in range(len(seq)):
		diff = sum_seq - seq[j]
		if diff not in res:
			res[diff] = (i + 1, j + 1)
		if diff in res and res[diff][0] != i + 1:
			print('YES')
			print(res[diff][0], res[diff][1])
			print(i + 1, j + 1)
			exit(0)
print('NO')


import os
import gc
import sys
from io import BytesIO, IOBase
from collections import Counter
from collections import deque
import heapq
import math
import statistics

def sin():
	return input()

def ain():
	return list(map(int, sin().split()))

def sain():
	return input().split()

def iin():
	return int(sin())
MAX = float('inf')
MIN = float('-inf')
MOD = 10 ** 9 + 7

def readTree(n, m):
	adj = [deque([]) for _ in range(n + 1)]
	for _ in range(m):
		(u, v) = ain()
		adj[u].append(v)
		adj[v].append(u)
	return adj

def solve(n, d):
	for i in range(n - 1):
		(l, s, se) = d[i]
		se = list(se)
		for j in range(i + 1, n):
			(lj, sj, sej) = d[j]
			for k in se:
				xx = s - k
				if sj - xx in sej:
					return [i + 1, j + 1, l[1:].index(k) + 1, lj[1:].index(sj - xx) + 1]
	return 'NO'

def main():
	k = iin()
	ks = deque([])
	d = deque([])
	x = deque([])
	for _ in range(k):
		n = iin()
		l = ain()
		s = sum(l)
		ks.append(l)
		for i in range(n):
			d.append(s - l[i])
			x.append(_ + 1)
	dd = dict()
	for i in range(len(d)):
		if d[i] not in dd:
			dd[d[i]] = set()
			dd[d[i]].add(x[i])
		else:
			dd[d[i]].add(x[i])
	flag = 0
	ansk = -1
	ansv = -1
	for (key, value) in dd.items():
		if len(value) > 1:
			flag = 1
			ansk = key
			ansv = value
			break
	if flag == 0:
		print('NO')
	else:
		print('YES')
		p = list(ansv)
		l1 = ks[p[0] - 1]
		l2 = ks[p[1] - 1]
		s1 = sum(l1)
		s2 = sum(l2)
		print(p[0], l1.index(s1 - ansk) + 1)
		print(p[1], l2.index(s2 - ansk) + 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 sys import stdin, stdout
from math import gcd, ceil, sqrt
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
tc = ii1()
sums = []
for k in range(tc):
	n = ii1()
	arr = iia()
	tot = sum(arr)
	for i in range(n):
		sums.append([tot - arr[i], k + 1, i + 1])
sums.sort()
for i in range(1, len(sums)):
	if sums[i - 1][0] == sums[i][0] and sums[i - 1][1] != sums[i][1]:
		print('YES')
		print(sums[i - 1][1], sums[i - 1][2])
		print(sums[i][1], sums[i][2])
		break
else:
	print('NO')


n = int(input())
A = []
As = []
for _ in range(n):
	input()
	A.append([int(i) for i in input().split()])
	As.append(sum(A[_]))
S = {}
good = []
for i in range(len(A)):
	for j in range(len(A[i])):
		t = As[i] - A[i][j]
		if t in S.keys() and S[t][0] != i:
			good = [S[t][0] + 1, S[t][1] + 1, i + 1, j + 1]
		S[t] = (i, j)
if len(good) > 0:
	print('YES')
	print(good[0], good[1])
	print(good[2], good[3])
else:
	print('NO')


d = {}
n = int(input())
summs = []
ok = False
for i in range(n):
	cur_summs = []
	l = int(input())
	nums = list(map(int, input().strip().split()))
	if ok:
		break
	cur = 0
	for j in range(l):
		cur += nums[j]
	summ = cur
	tmp_d = {}
	for j in range(l):
		cur = summ - nums[j]
		cur_summs.append(cur)
		tmp_d[cur] = j + 1
	cur_summs = list(set(cur_summs))
	for cur_summ in cur_summs:
		if cur_summ in d:
			ok = True
			print('YES')
			print(d[cur_summ][0], d[cur_summ][1])
			print(i + 1, tmp_d[cur_summ])
			break
		else:
			d[cur_summ] = [i + 1, tmp_d[cur_summ]]
if not ok:
	print('NO')


from typing import List, Dict, Tuple
n = int(input())
sums: List[int] = []
origSeqs: List[List[int]] = []
sortedSeqs: List[List[int]] = []
diffs: Dict[int, Tuple[int, int]] = {}
for i in range(0, n):
	input()
	s = [int(s) for s in input().split(' ')]
	sums.append(sum(s))
	origSeqs.append(s)
	sortedSeqs.append(sorted(list(dict.fromkeys(s))))

def finish(iMin, vMin, iMax, vMax):
	print('YES')
	print(iMin + 1, origSeqs[iMin].index(vMin) + 1)
	print(iMax + 1, origSeqs[iMax].index(vMax) + 1)
	exit()
for (i, series) in enumerate(sortedSeqs):
	for a in series:
		diff = sums[i] - a
		if diff in diffs:
			finish(i, a, diffs[diff][0], diffs[diff][1])
		diffs[diff] = (i, a)
print('NO')


R = lambda : map(int, input().split())
d = {}
for i in range(int(input())):
	input()
	L = list(R())
	s = sum(L)
	temp = set()
	for (j, x) in enumerate(L, 1):
		if x not in temp:
			temp.add(x)
			if d.get(s - x):
				print('YES')
				print(*d[s - x])
				print(i + 1, j)
				quit()
			d[s - x] = (i + 1, j)
print('NO')


arr = []
for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	s = sum(a)
	for i in range(n):
		arr.append([s - a[i], _, i])
arr.sort(key=lambda x: x[0])
f = False
for i in range(len(arr) - 1):
	if arr[i][0] == arr[i + 1][0] and arr[i][1] != arr[i + 1][1]:
		print('YES')
		print(arr[i][1] + 1, arr[i][2] + 1)
		print(arr[i + 1][1] + 1, arr[i + 1][2] + 1)
		f = True
		break
if f == False:
	print('NO')


l = []
for j in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	s = sum(a)
	for i in range(n):
		l += [[s - a[i], j + 1, i + 1]]
l.sort()
for i in range(len(l) - 1):
	if l[i][0] == l[i + 1][0] and l[i][1] != l[i + 1][1]:
		exit(print('YES\n', l[i][1], l[i][2], '\n', l[i + 1][1], l[i + 1][2]))
print('NO')


k = int(input())
Pos = []
Sums = [0] * k
D = dict()
for i in range(k):
	_sum = 0
	n = int(input())
	pos = list(map(int, input().split()))
	for el in pos:
		_sum += el
	Pos.append(pos)
	Sums[i] = _sum
for i in range(k):
	for j in range(len(Pos[i])):
		a = Sums[i] - Pos[i][j]
		if a in D:
			if D[a][0] != i:
				(a, b) = D[a]
				print('YES')
				print(a + 1, b + 1)
				print(i + 1, j + 1)
				exit()
		else:
			D[a] = (i, j)
else:
	print('NO')


k = int(input())
d = {}
for i in range(1, k + 1):
	n = int(input())
	a = list(map(int, input().split()))
	summa = sum(a)
	for (j, num) in enumerate(a, start=1):
		if summa - num in d and i != d[summa - num][0]:
			print('YES')
			print(i, j)
			print(*d[summa - num])
			exit(0)
		else:
			d[summa - num] = (i, j)
print('NO')


k = int(input())
a = {}
for i in range(k):
	n = int(input())
	b = list(map(int, input().split()))
	s = sum(b)
	for j in range(n):
		if str(s - b[j]) in a and a[str(s - b[j])][0] != i + 1:
			print('YES')
			print(a[str(s - b[j])][0], a[str(s - b[j])][1])
			print(i + 1, j + 1)
			exit()
		else:
			a[str(s - b[j])] = [i + 1, j + 1]
print('NO')


def main():
	k = int(input())
	d = dict()
	for i in range(1, k + 1):
		n = int(input())
		l = [int(x) for x in input().split()]
		s = sum(l)
		for j in range(n):
			possible_s = s - l[j]
			if possible_s in d:
				(p_i, p_j) = d[possible_s]
				if p_i != i:
					print('YES')
					print(*d[possible_s])
					print(*(i, j + 1))
					return
				else:
					pass
			else:
				d[possible_s] = (i, j + 1)
	print('NO')
	return
main()


k = int(input())
ls = []
for i in range(k):
	n = int(input())
	a = list(map(int, input().split()))
	t = sum(a)
	for j in range(n):
		ls.append([t - a[j], i + 1, j + 1])
ls.sort()
flag = False
for i in range(1, len(ls)):
	if ls[i - 1][0] == ls[i][0] and ls[i - 1][1] != ls[i][1]:
		flag = True
		break
if flag:
	print('YES')
	print(ls[i - 1][1], ls[i - 1][2])
	print(ls[i][1], ls[i][2])
else:
	print('NO')


n = int(input())
mp = {}

def solve(cnt):
	k = int(input())
	lst = list(map(int, input().split()))
	sm = sum(lst)
	for i in range(len(lst)):
		tmp = sm - lst[i]
		if tmp not in mp.keys():
			mp[tmp] = (cnt, i + 1)
		else:
			temp = mp[tmp]
			if temp[0] != cnt:
				print('YES')
				print(cnt, i + 1)
				print(temp[0], temp[1])
				exit()
for i in range(n):
	solve(i + 1)
print('NO')


n = int(input())
res1 = None
res2 = None
su = None
dict_of_sums = dict()
list_of_sums = dict()
posl_list = list()
for i in range(1, n + 1):
	temp = input()
	posl = list(map(int, input().split(' ')))
	posl_list.append(posl)
	sum_posl = sum(posl)
	if res1 is None:
		for el in posl:
			cur_sum = sum_posl - el
			if cur_sum not in list_of_sums.keys():
				list_of_sums[cur_sum] = i
			elif i != list_of_sums[cur_sum]:
				res1 = i
				res2 = list_of_sums[cur_sum]
				su = cur_sum
if res1 is None:
	print('NO')
	exit()
res1_x = None
res2_x = None
print('YES')
su1 = sum(posl_list[res1 - 1])
for (index, el) in enumerate(posl_list[res1 - 1]):
	if su == su1 - el:
		res1_x = index + 1
		break
su2 = sum(posl_list[res2 - 1])
for (index, el) in enumerate(posl_list[res2 - 1]):
	if su == su2 - el:
		res2_x = index + 1
		break
print(str(res1) + ' ' + str(res1_x))
print(str(res2) + ' ' + str(res2_x))


k = int(input())
dictionary = {}
a = []
b = []
found = 0
for i in range(0, k):
	if found == 1:
		continue
	n = int(input())
	str_ = input()
	arr = list(map(int, str_.split()))
	sm = sum(arr)
	local_dict = {}
	for j in range(0, n):
		arr[j] = sm - arr[j]
		if arr[j] not in local_dict:
			local_dict[arr[j]] = [i + 1, j + 1]
	for key in local_dict:
		if key not in dictionary:
			dictionary[key] = local_dict[key]
		else:
			a = local_dict[key]
			b = dictionary[key]
			found = 1
			break
if a:
	print('YES')
	print(*a)
	print(*b)
else:
	print('NO')


import os
import sys
from collections import defaultdict
from io import BytesIO, IOBase
nmbr = lambda : int(input())
lst = lambda : list(map(int, input().split()))

def main():
	n = nmbr()
	f = 0
	mp = defaultdict(list)
	for sq in range(n):
		x = nmbr()
		a = lst()
		sm = sum(a)
		vis = set()
		for i in range(x):
			if a[i] in vis:
				continue
			mp[sm - a[i]] += [[sq + 1, i + 1]]
			vis.add(a[i])
	for (k, l) in mp.items():
		if len(l) >= 2:
			f = 1
			print('YES')
			print(*l[0])
			print(*l[1])
			break
	if f == 0:
		print('NO')
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')
for t in range(1):
	main()


p = {}
for j in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	s = sum(a)
	for i in range(n):
		if s - a[i] in p:
			print('YES')
			print(j + 1, i + 1)
			print(*p[s - a[i]])
			exit()
	for x in range(n):
		p[s - a[x]] = [j + 1, x + 1]
print('NO')


from collections import defaultdict
from itertools import islice
n = int(input())
b = defaultdict(dict)
for i in range(n):
	m = int(input())
	a = list(map(int, input().split()))
	suma = sum(a)
	for (j, x) in enumerate(a):
		b[suma - x][i] = j
for c in b.values():
	if len(c) >= 2:
		((i, j), (k, l)) = islice(c.items(), 2)
		print('YES')
		print(i + 1, j + 1)
		print(k + 1, l + 1)
		break
else:
	print('NO')


tot_sqns = int(input())
sqns_lns = []
sqns = []
sqns_sums = []
sum_wo_ele_dict = dict()
found = False
for i in range(0, tot_sqns):
	lngt = int(input())
	sqn = list(map(int, input().split()))
	sqns_lns.append(lngt)
	sqns.append(sqn)
	sqns_sums.append(sum(sqn))
for i in range(0, tot_sqns):
	for j in range(0, sqns_lns[i]):
		swoele = sqns_sums[i] - sqns[i][j]
		if swoele in sum_wo_ele_dict and i != sum_wo_ele_dict[swoele][0]:
			found = True
			print('YES')
			print(sum_wo_ele_dict[swoele][0] + 1, sum_wo_ele_dict[swoele][1] + 1)
			print(i + 1, j + 1)
			break
		else:
			sum_wo_ele_dict[swoele] = (i, j)
	if found:
		break
if not found:
	print('NO')


__file__ = __file__.startswith('/home/a_farazei')

def input_():
	global __file__
	if not __file__:
		return input()
	if not hasattr(__file__, 'readline'):
		__file__ = open('input.txt', 'r')
	return __file__.readline()
n = int(input_())
sums = {}
for i in range(n):
	k = int(input_())
	arr = list(map(int, input_().split()))
	s = sum(arr)
	for (j, x) in enumerate(arr):
		q = s - x
		if q in sums and sums[q][0] != i + 1:
			print('YES')
			print('%d %d' % (i + 1, j + 1))
			print('%d %d' % sums[q])
			exit()
		else:
			sums[q] = (i + 1, j + 1)
print('NO')


from __future__ import print_function
import sys
import math
import os.path

def log(*args, **kwargs):
	print(*args, file=sys.stderr, **kwargs)

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

def nio(offset):
	return map(lambda x: int(x) + offset, input().split())

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

def toString(aList, sep=' '):
	return sep.join((str(x) for x in aList))

def toMapInvertIndex(aList):
	return {k: v for (v, k) in enumerate(aList)}
(k,) = ni()

def solve():
	n = []
	a = []
	s = []
	sn = []
	sdf = []
	m = {}
	for i in range(k):
		(nn,) = ni()
		aa = nia()
		ss = sum(aa)
		for (pi, x) in enumerate(aa):
			subSum = ss - x
			if subSum not in m:
				m[subSum] = (i, pi)
			else:
				(j, pj) = m[subSum]
				if j != i:
					print('YES')
					print(i + 1, pi + 1)
					print(j + 1, pj + 1)
					return
		n += [nn]
		a += [aa]
		sn += [ss]
	print('NO')
solve()


n = int(input())
has = {}
result = []
i = 0
Found = False
while not Found and i < n:
	length = int(input())
	sequence = list(map(int, input().split(' ')))
	total = sum(sequence)
	for j in range(len(sequence)):
		d = total - sequence[j]
		if d not in has:
			has[d] = (i + 1, j + 1)
		elif i + 1 != has[d][0]:
			result.append(has[d])
			result.append((i + 1, j + 1))
			Found = True
			break
	i += 1
if result != []:
	print('YES')
	for i in result:
		print(i[0], ' ', i[1])
else:
	print('NO')


k = int(input())
d = dict()
all_ok = False
for i in range(k):
	n = int(input())
	a = [int(s) for s in input().split(' ')]
	s = sum(a)
	for j in range(n):
		if all_ok:
			break
		x = s - a[j]
		if not x in d:
			d[x] = (i + 1, j + 1)
		elif d[x][0] != i + 1:
			print('YES')
			print(d[x][0], d[x][1])
			print(i + 1, j + 1)
			all_ok = True
if not all_ok:
	print('NO')


n = int(input())
arr = []
for _ in range(n):
	useless = input()
	arr += [list(map(int, input().split()))]
for i in range(len(arr)):
	mysum = sum(arr[i])
	arr[i] = [mysum - arr[i][j] for j in range(len(arr[i]))]
dic = {}
found = False
for i in range(1, len(arr) + 1):
	for num in arr[i - 1]:
		if num in dic:
			if dic[num] != i:
				ans = (num, dic[num], i)
				found = True
				break
		else:
			dic[num] = i
	if found:
		break
if not found:
	print('NO')
else:
	print('YES')
	print(ans[1], arr[dic[num] - 1].index(ans[0]) + 1)
	print(ans[2], arr[i - 1].index(ans[0]) + 1)


import os, 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')
from math import ceil
mod = 10 ** 9 + 7
for _ in range(1):
	k = int(input())
	triplet_array = []
	for i in range(k):
		n = int(input())
		a = list(map(int, input().split()))
		s = sum(a)
		for j in range(n):
			triplet_array.append((s - a[j], i, j))
	triplet_array.sort()
	for i in range(len(triplet_array) - 1):
		if triplet_array[i][0] == triplet_array[i + 1][0] and triplet_array[i][1] != triplet_array[i + 1][1]:
			print('YES')
			print(triplet_array[i][1] + 1, triplet_array[i][2] + 1)
			print(triplet_array[i + 1][1] + 1, triplet_array[i + 1][2] + 1)
			exit(0)
	print('NO')


import sys

class Scanner:

	def __init__(self):
		self.tokens = []
		self.index = -1
		for line in sys.stdin:
			self.tokens.extend(line.split())

	def next_token(self):
		self.index += 1
		return None if self.index == len(self.tokens) else self.tokens[self.index]

def main():
	scanner = Scanner()
	n = int(scanner.next_token())
	sequences = []
	for i in range(n):
		k = int(scanner.next_token())
		sequences.append([int(scanner.next_token()) for _ in range(k)])
	mp = dict()
	for (i, ar) in enumerate(sequences):
		s = sum(ar)
		for (j, v) in enumerate(ar):
			x = s - v
			if x in mp:
				print('YES')
				print('{} {}'.format(mp[x][0] + 1, mp[x][1] + 1))
				print('{} {}'.format(i + 1, j + 1))
				return
		for (j, v) in enumerate(ar):
			mp[s - v] = (i, j)
	print('NO')
main()


d = []
k = int(input())
for i in range(k):
	ni = int(input())
	ai = list(map(int, input().split()))
	s = sum(ai)
	for j in range(ni):
		d.append((s - ai[j], i + 1, j + 1))
d.sort()
ok = False
for i in range(len(d) - 1):
	if d[i][0] == d[i + 1][0] and d[i][1] != d[i + 1][1]:
		print('YES')
		print(d[i][1], d[i][2])
		print(d[i + 1][1], d[i + 1][2])
		ok = True
		break
if not ok:
	print('NO')


import sys

def solve(io):
	K = io.readInt()
	seen = dict()
	for i in range(1, K + 1):
		N = io.readInt()
		A = io.readIntArray(N, 1)
		total = sum(A[1:])
		curr = dict()
		for j in range(1, N + 1):
			val = total - A[j]
			if val in seen:
				io.println('YES')
				io.printlnArray(seen[val])
				io.printlnArray((i, j))
				return
			curr[val] = (i, j)
		for (k, v) in curr.items():
			seen[k] = v
	io.println('NO')

class IO:
	input = None
	output = None
	raw = ''
	buf = []
	pos = 0

	def __init__(self, inputStream, outputStream):
		self.input = inputStream
		self.output = outputStream

	def readToBuffer(self):
		self.raw = self.input.readline().rstrip('\n')
		self.buf = self.raw.split()
		self.pos = 0

	def readString(self):
		while self.pos == len(self.buf):
			self.readToBuffer()
		ans = self.buf[self.pos]
		self.pos += 1
		return ans

	def readInt(self):
		return int(self.readString())

	def readFloat(self):
		return float(self.readString())

	def readStringArray(self, N, offset=0):
		arr = [None] * offset
		for _ in range(0, N):
			arr.append(self.readString())
		return arr

	def readIntArray(self, N, offset=0):
		arr = [None] * offset
		for _ in range(0, N):
			arr.append(self.readInt())
		return arr

	def readFloatArray(self, N, offset=0):
		arr = [None] * offset
		for _ in range(0, N):
			arr.append(self.readFloat())
		return arr

	def readLine(self):
		while self.pos == len(self.buf):
			self.readToBuffer()
		if self.pos > 0:
			raise ValueError('Cannot call readline in the middle of a line.')
		return self.raw

	def print(self, s):
		self.output.write(str(s))

	def println(self, s):
		self.print(s)
		self.print('\n')

	def printlnArray(self, arr, sep=' '):
		self.println(sep.join((str(x) for x in arr)))

	def flushOutput(self):
		self.output.flush()
pythonIO = IO(sys.stdin, sys.stdout)
solve(pythonIO)
pythonIO.flushOutput()


from collections import Counter
n = int(input())
arr = []
p = dict()
v = 0
for i in range(n):
	h = int(input())
	arr = list(map(int, input().split()))
	s = sum(arr)
	q = dict()
	for j in range(len(arr)):
		if s - arr[j] in p:
			print('YES')
			print(*p[s - arr[j]])
			print(i + 1, j + 1)
			exit(0)
		q[s - arr[j]] = [i + 1, j + 1]
	for k in q:
		p[k] = q[k]
if v == 0:
	print('NO')


t = int(input())
ans = []
for i in range(t):
	q = int(input())
	l = list(map(int, input().split()))
	s = sum(l)
	for j in range(q):
		ans.append([s - l[j], i, j])
ans.sort()
c = 0
for i in range(len(ans) - 1):
	if ans[i][0] == ans[i + 1][0]:
		if ans[i][1] != ans[i + 1][1]:
			c = 1
			print('YES')
			print(ans[i][1] + 1, ans[i][2] + 1)
			print(ans[i + 1][1] + 1, ans[i + 1][2] + 1)
			break
if c == 0:
	print('NO')


t = int(input(''))
x = []
for i in range(t):
	n = int(input(''))
	arr = list(map(int, input().split()))
	s = sum(arr)
	for j in range(n):
		x.append([s - arr[j], i, j])
flag = 1
x.sort()
for i in range(len(x) - 1):
	if x[i][0] == x[i + 1][0] and x[i][1] != x[i + 1][1]:
		print('YES')
		print(x[i][1] + 1, x[i][2] + 1)
		print(x[i + 1][1] + 1, x[i + 1][2] + 1)
		flag = 0
		break
if flag:
	print('NO')


dp = []
n = int(input())
for i in range(n):
	n1 = int(input())
	s = list(map(int, input().split()))
	sm = sum(s)
	for j in range(n1):
		dp.append(tuple((sm - s[j], i + 1, j + 1)))
dp.sort()
t = True
for i in range(1, len(dp)):
	if dp[i][0] == dp[i - 1][0] and dp[i][1] != dp[i - 1][1]:
		t = False
		print('YES')
		print(dp[i][1], dp[i][2])
		print(dp[i - 1][1], dp[i - 1][2])
		break
if t:
	print('NO')


from functools import reduce

def input_ints():
	inp = input().split()
	ints = list(map(lambda i: int(i), inp))
	return ints
get_sum = lambda arr: reduce(lambda x, y: x + y, arr)
k = input_ints()[0]
n = []
a = []
for i in range(k):
	n.append(input_ints()[0])
	a.append(input_ints())
a_sums = []
for i in range(k):
	a_sums.append(get_sum(a[i]))
possible_sums = []
for i in range(k):
	seq = a[i]
	seq_sum = a_sums[i]
	for j in range(n[i]):
		possible_sums.append((seq_sum - seq[j], i, j))
possible_sums = sorted(possible_sums)
ans = []
for i in range(1, len(possible_sums)):
	current_sum = possible_sums[i]
	prev_sum = possible_sums[i - 1]
	if current_sum[0] == prev_sum[0] and current_sum[1] != prev_sum[1]:
		ans = [current_sum, prev_sum]
		break
if len(ans):
	print('YES')
	for a in ans:
		print(a[1] + 1, a[2] + 1)
else:
	print('NO')


import sys
from collections import defaultdict

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

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

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

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
K = INT()
S = set()
idxs = defaultdict(list)
Bs = []
for i in range(K):
	N = INT()
	A = LIST()
	sm = sum(A)
	B = [0] * N
	for (j, a) in enumerate(A):
		B[j] = sm - A[j]
	Bs.append(B)
	for b in set(B):
		idxs[b].append(i)
		S.add(b)
for b in S:
	if len(idxs[b]) >= 2:
		idx1 = idxs[b][0]
		idx2 = idxs[b][1]
		ans = []
		for (i, b2) in enumerate(Bs[idx1]):
			if b2 == b:
				ans.append((idx1 + 1, i + 1))
				break
		for (i, b2) in enumerate(Bs[idx2]):
			if b2 == b:
				ans.append((idx2 + 1, i + 1))
				break
		break
else:
	NO()
	exit()
YES()
print(*ans[0])
print(*ans[1])


k = int(input())
d = {}
for i in range(k):
	n = int(input())
	a = list(map(int, input().split()))
	s = sum(a)
	for j in range(n):
		x = s - a[j]
		if x in d and d[x][0] != i:
			print('YES')
			print(d[x][0] + 1, d[x][1] + 1)
			print(i + 1, j + 1)
			exit()
		elif x not in d:
			d[x] = (i, j)
print('NO')


def go():
	seq_no = int(input())
	seq = []
	sum_seq = []
	keep = {}
	e = {}
	for i in range(seq_no):
		input()
		seq.append([int(i) for i in input().split(' ')])
		sum_seq.append(sum(seq[-1]))
		for j in range(len(seq[i])):
			keep.setdefault(sum_seq[i] - seq[i][j], set())
			keep[sum_seq[i] - seq[i][j]].add(i)
			e[i, seq[i][j]] = j
	for i in range(seq_no):
		for j in range(len(seq[i])):
			if sum_seq[i] - seq[i][j] in keep:
				for k in keep[sum_seq[i] - seq[i][j]]:
					if k != i:
						print('YES')
						print('{} {}'.format(i + 1, j + 1))
						print('{} {}'.format(k + 1, e[k, sum_seq[k] - sum_seq[i] + seq[i][j]] + 1))
						return
	print('NO')
go()


k = int(input())
lis = []
for i in range(k):
	n = int(input())
	a = [int(x) for x in input().split()]
	s = 0
	for q in range(n):
		s += a[q]
	for j in range(n):
		lis.append((s - a[j], i + 1, j + 1))
lis.sort()
flag = 0
for i in range(len(lis) - 1):
	if lis[i][0] == lis[i + 1][0] and lis[i][1] != lis[i + 1][1]:
		flag = 1
		print('YES')
		print(lis[i][1], lis[i][2])
		print(lis[i + 1][1], lis[i + 1][2])
		break
if flag == 0:
	print('NO')


n = int(input())
x = []
for i in range(n):
	q = int(input())
	li = [*map(int, input().split())]
	ss = sum(li)
	for j in range(q):
		x.append([ss - li[j], j, i])
x.sort()
for i in range(1, len(x)):
	if x[i][0] == x[i - 1][0] and x[i][2] != x[i - 1][2]:
		print('YES')
		print(x[i][2] + 1, x[i][1] + 1)
		print(x[i - 1][2] + 1, x[i - 1][1] + 1)
		exit()
print('NO')


k = int(input())
m = {}
for i in range(1, k + 1):
	n = int(input())
	ar = list(map(int, input().split()))
	s = sum(ar)
	for j in range(0, n):
		if s - ar[j] in m and m[s - ar[j]][0] != i:
			print('YES')
			print(i, j + 1)
			print(m[s - ar[j]][0], m[s - ar[j]][1])
			exit()
		else:
			m[s - ar[j]] = [i, j + 1]
print('NO')


K = int(input())
src = []
for i in range(K):
	n = int(input())
	li = list(map(int, input().split()))
	src.append(li)
d = {}
for (i, li) in enumerate(src):
	sm = sum(li)
	for (j, a) in enumerate(li):
		if sm - a in d:
			if d[sm - a][0] == i + 1:
				continue
			else:
				(i0, j0) = d[sm - a]
				print('YES')
				print(i0, j0)
				print(i + 1, j + 1)
				exit()
		else:
			d[sm - a] = (i + 1, j + 1)
print('NO')


arr = []
s = []
s1 = []
for i in range(int(input())):
	n = int(input())
	arr.append(list(map(int, input().split())))
	summ = sum(arr[i])
	s.append(set())
	s1.append([])
	for j in arr[i]:
		s[i].add(summ - j)
		s1[i].append(summ - j)
d = {}
d1 = {}
for i in range(len(s)):
	for j in s[i]:
		if j in d.keys():
			d[j] += 1
			d1[j].append(i)
		else:
			d[j] = 1
			d1[j] = [i]
flag = 0
for i in d.keys():
	if d[i] > 1:
		flag = 1
		ans = i
if flag == 1:
	print('YES')
	print(d1[ans][0] + 1, s1[d1[ans][0]].index(ans) + 1)
	print(d1[ans][1] + 1, s1[d1[ans][1]].index(ans) + 1)
else:
	print('NO')


import sys
input = sys.stdin.buffer.readline
t = int(input())
sums = []
for k in range(t):
	n = int(input())
	a = [int(el) for el in input().split()]
	s = sum(a)
	for i in range(n):
		sums.append((s - a[i], k, i))
sums.sort()
for i in range(len(sums) - 1):
	if sums[i][0] == sums[i + 1][0] and sums[i][1] != sums[i + 1][1]:
		print('YES')
		print(sums[i][1] + 1, sums[i][2] + 1)
		print(sums[i + 1][1] + 1, sums[i + 1][2] + 1)
		exit(0)
print('NO')


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():
	k = int(input())
	d = collections.defaultdict()
	res = []
	f = False
	temp = []
	for i in range(k):
		n = int(input())
		a = list(map(int, input().split()))
		temp.append(a)
	for i in range(len(temp)):
		s = sum(temp[i])
		t = temp[i]
		for j in range(len(t)):
			if s - t[j] in d.keys() and d[s - t[j]] != i + 1:
				f = True
				res.append(d[s - t[j]])
				res.append(i + 1)
				res.append(s - t[j])
				break
			d[s - t[j]] = i + 1
		if f:
			break
	if not f:
		print('NO')
	else:
		print('YES')
		(first, second) = (temp[res[0] - 1], temp[res[1] - 1])
		for j in range(len(first)):
			if sum(first) - first[j] == res[2]:
				print(res[0], j + 1)
				break
		for j in range(len(second)):
			if sum(second) - second[j] == res[2]:
				print(res[1], j + 1)
				break
main()


n = int(input())
dic = {}
for i in range(n):
	l1 = int(input())
	arr = list(map(int, input().split()))
	s1 = sum(arr)
	for j in range(l1):
		v = s1 - arr[j]
		if v in dic and dic[v][0] != i + 1:
			print('YES')
			print(dic[v][0], dic[v][1])
			print(i + 1, j + 1)
			exit()
		else:
			dic[v] = (i + 1, j + 1)
print('NO')


a = int(input())
c = 0
sum_array = []
while a > 0:
	b = int(input())
	k = list(map(int, input().split()))
	fix_sum = sum(k)
	for i in range(len(k)):
		ss = fix_sum - k[i]
		sum_array.append((ss, c + 1, i + 1))
	c += 1
	a -= 1
sum_array = sorted(sum_array)
yes = 0
for i in range(1, len(sum_array)):
	if sum_array[i][0] == sum_array[i - 1][0] and sum_array[i][1] != sum_array[i - 1][1]:
		print('YES')
		print(sum_array[i][1], sum_array[i][2])
		print(sum_array[i - 1][1], sum_array[i - 1][2])
		yes = 1
		break
if yes == 0:
	print('NO')


import sys

def main():
	dict_n = {}
	n = int(input())
	s = sys.stdin.readlines()
	N = [list(map(int, s[i].strip().split())) for i in range(1, len(s), 2)]
	sum_N = [sum(N[x]) for x in range(n)]
	for i in range(n):
		for j in range(len(N[i])):
			current_sum = sum_N[i] - N[i][j]
			if current_sum not in dict_n:
				dict_n[current_sum] = [i + 1, j + 1]
			elif dict_n[current_sum][0] != i + 1:
				print('YES')
				print(dict_n[current_sum][0], dict_n[current_sum][1])
				print(i + 1, j + 1)
				return
	print('NO')
main()


kk = int(input())
d = {}
f = 0
for i in range(kk):
	n = int(input())
	p = {}
	su = 0
	l = list(map(int, input().split()))
	for j in range(n):
		su += l[j]
	for j in range(n):
		try:
			k = d[su - l[j]]
			if k[0] != i + 1:
				f = 1
				print('YES')
				print(k[0], k[1])
				print(i + 1, j + 1)
				break
		except KeyError:
			d[su - l[j]] = [i + 1, j + 1]
	if f == 1:
		break
if f == 0:
	print('NO')


k = int(input())
l = []
for i in range(k):
	input()
	a = list(map(int, input().split()))
	s = sum(a)
	b = [(s - x, i, j) for (j, x) in enumerate(a)]
	l.extend(b)
l.sort(key=lambda x: x[0])
it = iter(l)
x = next(it)
while True:
	try:
		y = next(it)
	except StopIteration as e:
		break
	if x[0] == y[0]:
		if x[1] == y[1]:
			continue
		else:
			print('YES')
			print(x[1] + 1, x[2] + 1)
			print(y[1] + 1, y[2] + 1)
			exit()
	else:
		x = y
print('NO')


from collections import *
from itertools import *
from random import *
from bisect import *
from string import *
from queue import *
from heapq import *
from math import *
from sys import *
from re import *

def fast():
	return stdin.readline().strip()

def zzz():
	return [int(i) for i in fast().split()]
(z, zz) = (input, lambda : list(map(int, z().split())))
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def output(answer):
	stdout.write(str(answer))
dx = [-1, 1, 0, 0, 1, -1, 1, -1]
dy = [0, 0, 1, -1, 1, -1, -1, 1]
num = int(z())
lst = []
p = 0
for _ in range(num):
	n = int(z())
	arr = zzz()
	p += n
	s = sum(arr)
	for (i, j) in enumerate(arr):
		lst.append((s - j, _, i))
lst = sorted(lst)
prev = lst[0]
for i in range(1, p):
	curr = lst[i]
	if prev[0] == curr[0] and prev[1] != curr[1]:
		print('YES')
		print(prev[1] + 1, prev[2] + 1)
		print(curr[1] + 1, curr[2] + 1)
		exit()
	prev = curr
print('NO')


from itertools import combinations
from collections import defaultdict
get = lambda : map(int, input().split())
n = int(input())
arr3 = []
arr2 = []
d = {}
for i in range(n):
	input()
	l = list(get())
	lookup = {elem: index for (index, elem) in enumerate(l)}
	s = sum(l)
	for j in lookup:
		if s - j not in d:
			d[s - j] = (i, lookup[j])
		else:
			print('YES')
			print(i + 1, lookup[j] + 1)
			(a, b) = d[s - j]
			print(a + 1, b + 1)
			exit()
print('NO')
d = defaultdict(list)


import sys, math
from collections import deque, defaultdict
import operator as op
from functools import reduce
from itertools import permutations
import heapq
I = sys.stdin.readline
alpha = 'abcdefghijklmnopqrstuvwxyz'

def ii():
	return int(I().strip())

def li():
	return list(map(int, I().strip().split()))

def mi():
	return map(int, I().strip().split())

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

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

def isPrime(n):
	if n <= 1:
		return False
	elif n <= 2:
		return True
	else:
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				return False
		return True

def main():
	k = ii()
	tmp = []
	for i in range(k):
		n = ii()
		arr = li()
		sum_ = sum(arr)
		for j in range(n):
			tmp.append([i + 1, j + 1, sum_ - arr[j]])
	tmp = sorted(tmp, key=lambda x: x[2])
	for i in range(len(tmp) - 1):
		x = tmp[i]
		y = tmp[i + 1]
		if x[2] == y[2] and x[0] != y[0]:
			print('YES')
			print(x[0], x[1])
			print(y[0], y[1])
			break
	else:
		print('NO')
main()


m = int(input())
a = []
for i in range(m):
	n = int(input())
	a.append(list(map(int, input().split())))
d = dict()
f = 0
for i in range(m):
	summ = sum(a[i])
	for j in range(len(a[i])):
		if summ - a[i][j] in d:
			if d[summ - a[i][j]][0] != i + 1:
				print('YES')
				print(*d[summ - a[i][j]])
				print(i + 1, j + 1)
				f = 1
				break
		d[summ - a[i][j]] = [i + 1, j + 1]
	if f:
		break
if f == 0:
	print('NO')


k = int(input())
d = {}
for i in range(k):
	n = int(input())
	a = list(map(int, input().split()))
	s = sum(a)
	j = 0
	for _ in a:
		cur = s - _
		if cur in d:
			if d[cur][0] != i:
				print('YES')
				print(i + 1, j + 1)
				print(d[cur][0] + 1, d[cur][1] + 1)
				exit()
		else:
			d[cur] = (i, j)
		j += 1
print('NO')


k = int(input())
s = []
Total = set()
for i in range(k):
	n = int(input())
	s.append(list(map(int, input().split())))
	X = sum(s[i])
	for j in range(len(s[i])):
		if (i, X - s[i][j]) not in Total:
			Total.add((i, X - s[i][j]))
			Total.add((i, j, X - s[i][j]))
flag = True
test = []
for i in Total:
	if len(i) == 3:
		test.append(i)
test.sort(key=lambda x: x[2])
for i in range(len(test) - 1):
	if test[i][2] == test[i + 1][2]:
		if test[i][0] != test[i + 1][0]:
			print('YES')
			print(test[i][0] + 1, test[i][1] + 1)
			print(test[i + 1][0] + 1, test[i + 1][1] + 1)
			flag = False
			break
if flag:
	print('NO')


d = {}
for i in range(int(input())):
	n = int(input())
	mass = list(map(int, input().split()))
	s = sum(mass)
	for (index, value) in enumerate(mass, 1):
		if s - value in d and i + 1 != d[s - value][0]:
			second = index
			second_mass = i + 1
			print('YES')
			print(i + 1, index)
			print(d[s - value][0], d[s - value][1])
			break
		d[s - value] = [i + 1, index]
	else:
		continue
	break
else:
	print('NO')


k = int(input())
d = {}
ans = []
f = 0
for i in range(k):
	n = int(input())
	a = list(map(int, input().split()))
	s = sum(a)
	for j in range(n):
		if s - a[j] in d:
			(x, y) = d[s - a[j]]
			if not x == i + 1:
				ans = [[x, y], [i + 1, j + 1]]
				f = 1
		else:
			d[s - a[j]] = (i + 1, j + 1)
		if f:
			break
	if f:
		break
print('YES' if f else 'NO')
if f:
	for ans0 in ans:
		print(*ans0)


k = int(input())
b = {}
e = []
t = 0
for i in range(k):
	n = int(input())
	a = list(map(int, input().split()))
	c = set(a)
	l = sum(a)
	e.append(a)
	for j in c:
		q = l - j
		if q in b:
			s = j
			x = i + 1
			t += 1
			break
		else:
			b[q] = i + 1
	if t == 1:
		break
if t == 0:
	print('NO')
else:
	print('YES')
	p = b[q]
	d = e[p - 1]
	p = sum(d)
	l = len(d)
	for i in range(l):
		if d[i] == p - q:
			print(b[q], i + 1)
			break
	l = len(a)
	for i in range(l):
		if a[i] == s:
			print(x, i + 1)
			break


k = int(input())
v = []
for i in range(0, k):
	sum = 0
	n = int(input())
	a = []
	s = input()
	s = s.split(' ')
	for j in range(0, n):
		now = int(s[j])
		a.append(now)
		sum += now
	for j in range(0, n):
		v.append([sum - a[j], i + 1, j + 1])
v.sort()
for i in range(0, len(v) - 1):
	if v[i][0] == v[i + 1][0] and v[i][1] != v[i + 1][1]:
		print('YES')
		print(v[i][1], ' ', v[i][2])
		print(v[i + 1][1], ' ', v[i + 1][2])
		break
else:
	print('NO')


from collections import defaultdict
k = int(input())
d = defaultdict(list)
flag = -1
for i in range(k):
	if flag == 1:
		break
	else:
		n = int(input())
		if n != 0:
			L = list(map(int, input().split(' ')))
			L_sum = sum(L)
			for (ind, x) in enumerate(L):
				val = L_sum - x
				if val not in d:
					d[val] = [i, ind]
				elif i != d[val][0]:
					flag = 1
					print('YES')
					print(1 + d[val][0], 1 + d[val][1])
					print(1 + i, 1 + ind)
					break
if flag == -1:
	print('NO')


k = int(input())
sums = {}
found = False
for i in range(k):
	seq_len = int(input())
	seq = [int(s) for s in input().split(' ')]
	seq_sum = sum(seq)
	for j in range(seq_len):
		sum_without = seq_sum - seq[j]
		if sum_without in sums:
			if not found and sums[sum_without][0] != i:
				print('YES\n' + str(sums[sum_without][0] + 1) + ' ' + str(sums[sum_without][1] + 1) + '\n' + str(i + 1) + ' ' + str(j + 1))
				found = True
		else:
			sums[sum_without] = (i, j)
if not found:
	print('NO')


k = int(input())
dic = {}
for i in range(k):
	n = int(input())
	a = list(map(int, input().split()))
	s = sum(a)
	for (xi, x) in enumerate(a):
		s2 = s - x
		if s2 in dic and dic[s2][0] != i + 1:
			print('YES')
			print(i + 1, xi + 1)
			print(*dic[s2])
			exit()
		else:
			dic[s2] = (i + 1, xi + 1)
print('NO')


k = int(input())
dict = {}
count = 0
for iter in range(k):
	n = int(input())
	a = [int(x) for x in input().split()]
	if count == 0:
		s = sum(a)
		d = {}
		for i in range(0, n):
			d[s - a[i]] = [iter + 1, i + 1]
		for i in d:
			if i not in dict:
				dict[i] = d[i]
			else:
				count = 1
				ans = [[dict[i][0], dict[i][1]], [d[i][0], d[i][1]]]
				break
if count == 0:
	print('NO')
else:
	print('YES')
	print(ans[0][0], ans[0][1])
	print(ans[1][0], ans[1][1])


k = int(input())
from collections import defaultdict
ls = []
ln = []
x = []
flag = 0
d = defaultdict(int)
for i in range(k):
	n1 = int(input())
	x.append(list(map(int, input().split())))
	s = sum(x[i])
	for j in range(len(x[i])):
		if d[s - x[i][j]] == 0:
			d[s - x[i][j]] = i + 1
		if d[s - x[i][j]] != i + 1 and flag == 0:
			print('YES')
			print(d[s - x[i][j]])
			print(x[d[s - x[i][j]] - 1].index(sum(x[d[s - x[i][j]] - 1]) - (s - x[i][j])) + 1)
			print(i + 1)
			print(j + 1)
			flag = 1
if flag == 0:
	print('NO')


from collections import defaultdict

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

def main():
	(n_seqs,) = read_nums()
	seqs = []
	for _ in range(n_seqs):
		input()
		seqs.append(read_nums())
	d = {}
	for (seq_index, seq) in enumerate(seqs):
		seq_sum = sum(seq)
		for (elem_index, elem) in enumerate(seq):
			d[seq_index + 1, seq_sum - elem] = elem_index + 1
	sorted_items = sorted(d.items(), key=lambda x: x[0][1])
	for i in range(1, len(sorted_items)):
		one = sorted_items[i - 1]
		two = sorted_items[i]
		(one_key, one_val) = one
		(two_key, two_val) = two
		if one_key[1] == two_key[1]:
			print('YES')
			print(one_key[0], one_val)
			print(two_key[0], two_val)
			return
	print('NO')
main()


t = []
k = int(input())
for i in range(k):
	n = int(input())
	a = list(map(int, input().split()))
	s = sum(a)
	for j in range(n):
		t.append((s - a[j], i + 1, j + 1))
t.sort()
f = 0
res = []
for i in range(len(t) - 1):
	if t[i][0] == t[i + 1][0]:
		if t[i][1] != t[i + 1][1]:
			f = 1
			res.append(str(t[i][1]) + ' ' + str(t[i][2]))
			res.append(str(t[i + 1][1]) + ' ' + str(t[i + 1][2]))
			break
if not f:
	print('NO')
else:
	print('YES')
	print('\n'.join(res))


k = int(input())
t = []
for i in range(k):
	n = int(input())
	seq = list(map(int, input().split()))
	s = sum(seq)
	for j in range(n):
		t.append((s - seq[j], i + 1, j + 1))
t.sort(key=lambda x: x[0])
for i in range(len(t) - 1):
	if t[i][0] == t[i + 1][0] and t[i][1] != t[i + 1][1]:
		print('YES')
		print(t[i][1], t[i][2])
		print(t[i + 1][1], t[i + 1][2])
		break
else:
	print('NO')


t = int(input())
c = []
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	k = sum(a)
	for i in range(len(a)):
		a[i] = k - a[i]
	c.append(a)
d = {}
for i in range(len(c)):
	for j in range(len(c[i])):
		d[c[i][j]] = []
for i in range(len(c)):
	for j in range(len(c[i])):
		d[c[i][j]].append([i + 1, j + 1])
for key in d:
	for i in range(len(d[key]) - 1):
		if d[key][i][0] != d[key][i + 1][0]:
			print('YES')
			print(*d[key][i])
			print(*d[key][i + 1])
			exit()
print('NO')


t = int(input())
dic = {}
for z in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	sarr = sum(arr + [0])
	for i in range(n):
		if dic.get(sarr - arr[i]) is None:
			dic[sarr - arr[i]] = (z + 1, i + 1)
		else:
			midx = dic[sarr - arr[i]]
			if midx[0] != z + 1:
				print('YES')
				print(midx[0], midx[1])
				print(z + 1, i + 1)
				exit()
print('NO')


import sys
inp = sys.stdin.readlines()
ii = 0
out = []
k = int(inp[ii])
ii += 1
allcombos = []
for s in range(1, k + 1):
	n = int(inp[ii])
	ii += 1
	seq = [int(ele) for ele in inp[ii].split()]
	ii += 1
	seqsum = sum(seq)
	for elem in set(seq):
		allcombos.append([s, seq.index(elem), seqsum - elem])
allcombos.sort(key=lambda x: x[2])
used = []
allcombos1 = []
[allcombos1.append(x) for x in allcombos if x not in used]
for comb in range(1, len(allcombos1)):
	if allcombos1[comb][2] == allcombos1[comb - 1][2] and allcombos1[comb][0] != allcombos1[comb - 1][0]:
		print('YES')
		print(allcombos1[comb][0], allcombos1[comb][1] + 1)
		print(allcombos1[comb - 1][0], allcombos1[comb - 1][1] + 1)
		exit()
print('NO')


import sys
k = int(input())
ss = list()
ss_sum = list()
for i in range(k):
	n = int(input())
	arr = list(map(int, input().split()))
	c_sum = sum(arr)
	for (j, v) in enumerate(arr):
		ss_sum.append([c_sum - v, i, j])
ss = sorted(ss_sum, key=lambda x: x[0])
for i in range(len(ss) - 1):
	if ss[i][0] == ss[i + 1][0] and ss[i][1] != ss[i + 1][1]:
		print('YES')
		print(ss[i][1] + 1, ss[i][2] + 1)
		print(ss[i + 1][1] + 1, ss[i + 1][2] + 1)
		sys.exit()
print('NO')


import os
from io import BytesIO, IOBase
import sys
from collections import defaultdict, deque, Counter
from math import sqrt, pi, ceil, log, inf, gcd, floor
from itertools import combinations, permutations
from bisect import *
from fractions import Fraction
from heapq import *
from random import randint

def main():
	k = int(input())
	(a, f, ans) = (Counter(), 1, [])
	for i in range(k):
		n = int(input())
		b = list(map(int, input().split()))
		if f:
			z = sum(b)
			for j in range(n):
				y = a[z - b[j]]
				if not y:
					a[z - b[j]] = (i + 1, j + 1)
				elif y[0] != i + 1:
					f = 0
					ans.append((i + 1, j + 1))
					ans.append(y)
	if f:
		print('NO')
	else:
		print('YES')
		print(*ans[0])
		print(*ans[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 sys import stdin, stdout

def rint():
	return map(int, stdin.readline().split())
k = int(input())
l = [0] * k
a = []
s = [0] * k
lists = []
for i in range(k):
	l[i] = int(input())
	tmp = list(rint())
	a.append(tmp)
	s[i] = sum(a[i])
	tmp_set = set()
	for j in range(l[i]):
		a[i][j] = s[i] - a[i][j]
		if not a[i][j] in tmp_set:
			tmp_set.add(a[i][j])
			lists.append(tuple([i + 1, a[i][j], j + 1]))
lists.sort(key=lambda x: x[1])
for i in range(len(lists) - 1):
	if lists[i][1] == lists[i + 1][1]:
		print('YES')
		print(lists[i][0], lists[i][2])
		print(lists[i + 1][0], lists[i + 1][2])
		exit()
print('NO')


import sys
import math
import collections
import bisect

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()
for t in range(1):
	n = int(input())
	arr = dict()
	sol = []
	done = False
	for i in range(n):
		size = int(input())
		row = get_list()
		ans = [sum(row)] * size
		if done == True:
			continue
		for j in range(size):
			ans[j] -= row[j]
		for j in range(size):
			if ans[j] not in arr:
				arr[ans[j]] = (i + 1, j + 1)
			else:
				if arr[ans[j]][0] == i + 1:
					continue
				sol = [arr[ans[j]], (i + 1, j + 1)]
				done = True
	if done == True:
		print('YES')
		print(*sol[0])
		print(*sol[1])
	else:
		print('NO')


k = int(input())
hashi = dict()
poss = 0
for i in range(k):
	n = int(input())
	l = input().split()
	li = [int(i) for i in l]
	z = sum(li)
	for j in range(n):
		y = z - li[j]
		if y in hashi and hashi[y][0] != i:
			ans = (hashi[y][0], hashi[y][1], i, j)
			poss = 1
			break
		hashi[y] = (i, j)
	if poss:
		break
if poss:
	print('YES')
	print(ans[0] + 1, ans[1] + 1)
	print(ans[2] + 1, ans[3] + 1)
else:
	print('NO')


k = int(input())
d = dict()
for y in range(1, k + 1):
	d1 = dict()
	n = int(input())
	a = list(map(int, input().split()))
	s = sum(a)
	for i in range(n):
		x = s - a[i]
		if x in d:
			print('YES')
			print(*d[x])
			print(y, i + 1)
			exit(0)
		d1[x] = [y, i + 1]
	for i in d1.keys():
		d[i] = d1[i]
print('NO')


k = int(input())
n = []
seq = []
for i in range(k):
	n.append(int(input()))
	seq.append([int(i) for i in input().split(' ')])
sums = [sum(sequence) for sequence in seq]
troiki = []
for i in range(k):
	for j in range(n[i]):
		troiki.append([sums[i] - seq[i][j], i + 1, j + 1])
troiki = sorted(troiki, key=lambda x: x[0])
out = None
for i in range(len(troiki) - 1):
	if troiki[i][0] == troiki[i + 1][0]:
		if troiki[i][1] != troiki[i + 1][1]:
			out = [troiki[i][1], troiki[i][2], troiki[i + 1][1], troiki[i + 1][2]]
			break
if out:
	print('YES')
	print(out[0], out[1])
	print(out[2], out[3])
else:
	print('NO')


k = int(input())
n = []
seq = []
for i in range(k):
	n.append(int(input()))
	seq.append([0] + [int(j) for j in input().split()])
	for j in range(1, len(seq[i])):
		seq[i][j] += seq[i][j - 1]
all_sum = []
for i in range(k):
	all_sum.append([])
	for j in range(1, n[i] + 1):
		all_sum[i].append(seq[i][n[i]] - seq[i][j] + seq[i][j - 1])
d = {}
for i in range(k):
	for j in all_sum[i]:
		d[j] = {}
for i in range(k):
	for j in all_sum[i]:
		d[j][i] = i
for i in d.keys():
	if len(d[i]) >= 2:
		print('YES')
		x = list(d[i].keys())[0]
		y = list(d[i].keys())[1]
		print('{} {}'.format(x + 1, all_sum[x].index(i) + 1))
		print('{} {}'.format(y + 1, all_sum[y].index(i) + 1))
		quit()
print('NO')


from sys import stdin
k = int(stdin.readline())
seq = []
sums = []
a = []
for i in range(k):
	n = int(stdin.readline())
	seq.append(list(map(int, stdin.readline().split())))
	sums.append(sum(seq[-1]))
	seen = set()
	for (j, v) in enumerate(seq[i]):
		s = sums[i] - v
		if s not in seen:
			seen.add(s)
			a.append((s, i + 1, j + 1))
a.sort()
for i in range(len(a) - 1):
	if a[i][0] == a[i + 1][0]:
		print('YES\n%d %d\n%d %d' % (a[i][1], a[i][2], a[i + 1][1], a[i + 1][2]))
		break
else:
	print('NO')


k = int(input())
sequences = []
minmax = [(min(seq), max(seq)) for seq in sequences]
sums = [sum(seq) for seq in sequences]
total = []
for i in range(k):
	n = int(input())
	sequences.append([int(v) for v in input().split()])
	summed = sum(sequences[-1])
	total.extend([(summed - v, (i + 1, j + 1)) for (j, v) in enumerate(sequences[-1])])
total.sort()
printed = False
for i in range(len(total) - 1):
	if total[i][0] == total[i + 1][0] and total[i][1][0] != total[i + 1][1][0]:
		print('YES')
		print('{} {}'.format(total[i][1][0], total[i][1][1]))
		print('{} {}'.format(total[i + 1][1][0], total[i + 1][1][1]))
		printed = True
		break
if not printed:
	print('NO')


k = int(input())
lines = list()
for _ in range(k):
	input()
	lines.append(list(map(int, input().split())))
sums = dict()
xs = list()
res_i = -1
res_j = -1
res_x = -1
res_y = -1
for i in range(len(lines)):
	s = sum(lines[i])
	buf = dict()
	for x in range(len(lines[i])):
		key = s - lines[i][x]
		if key in sums:
			res_i = i
			res_x = x
			(res_j, res_y) = sums[key]
		else:
			buf[key] = (i, x)
	sums.update(buf)
if res_i == -1:
	print('NO')
else:
	print('YES')
	print(res_i + 1, res_x + 1)
	print(res_j + 1, res_y + 1)


k = int(input())
HELLO_ELON_MUSK = []
for i in range(k):
	n = int(input())
	s = list(map(int, input().split()))
	X = sum(s)
	for j in range(len(s)):
		HELLO_ELON_MUSK.append((X - s[j], i, j))
flag = True
HELLO_ELON_MUSK.sort()
for i in range(len(HELLO_ELON_MUSK) - 1):
	if HELLO_ELON_MUSK[i][0] == HELLO_ELON_MUSK[i + 1][0] and HELLO_ELON_MUSK[i][1] != HELLO_ELON_MUSK[i + 1][1]:
		print('YES')
		print(HELLO_ELON_MUSK[i][1] + 1, HELLO_ELON_MUSK[i][2] + 1)
		print(HELLO_ELON_MUSK[i + 1][1] + 1, HELLO_ELON_MUSK[i + 1][2] + 1)
		flag = False
		break
if flag:
	print('NO')


def main():
	import sys
	input = sys.stdin.buffer.readline
	import collections
	k = int(input())
	ni = [0] * k
	a = [[] for i in range(k)]
	for i in range(k):
		ni[i] = int(input())
		a[i] = list(map(int, input().split()))
	sa = [sum(a[i]) for i in range(k)]
	d = collections.defaultdict(tuple)
	for i in range(k):
		s = sa[i]
		for j in range(ni[i]):
			if s - a[i][j] in d and d[s - a[i][j]][0] != i + 1:
				print('YES')
				print(i + 1, j + 1)
				print(*d[s - a[i][j]])
				exit(0)
			else:
				d[s - a[i][j]] = (i + 1, j + 1)
	print('NO')
main()


from queue import PriorityQueue
k = int(input())
pqueue = PriorityQueue()
found = False
tam = int(input())
valores = [int(i) for i in input().split()]
soma = sum(valores)
choosen = {}
superchoosen = {}
i = 0
while i < tam:
	if valores[i] not in choosen:
		choosen[valores[i]] = 1
		superchoosen[soma - valores[i]] = [1, i + 1]
	i += 1
j = 1
while j < k:
	tam = int(input())
	valores = [int(i) for i in input().split()]
	soma = sum(valores)
	choosen = {}
	i = 0
	while i < tam and (not found):
		if valores[i] not in choosen:
			choosen[valores[i]] = 1
			if soma - valores[i] not in superchoosen:
				superchoosen[soma - valores[i]] = [j + 1, i + 1]
			else:
				(ri, rx, rj, ry) = superchoosen[soma - valores[i]] + [j + 1, i + 1]
				found = True
		i += 1
	j += 1
if found:
	print('YES')
	print(ri, rx)
	print(rj, ry)
else:
	print('NO')


arr = {}
for i in range(int(input())):
	input()
	x = list(map(int, input().split()))
	z = sum(x)
	for (j, a) in enumerate(map(lambda y: z - y, x)):
		if a in arr:
			if arr[a][0] is not i:
				print('YES')
				print(arr[a][0] + 1, arr[a][1] + 1)
				print(i + 1, j + 1)
				exit()
		else:
			arr[a] = (i, j)
print('NO')


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 si():
	return input()

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

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

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

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
import sys
input = sys.stdin.readline
scanner = lambda : int(input())
string = lambda : input().rstrip()
get_list = lambda : list(read())
read = lambda : map(int, input().split())
get_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

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

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

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

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(beauty, s, n, count):
	pass
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
alphs = 'abcdefghijklmnopqrstuvwxyz'
from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect

def solve():
	k = scanner()
	trippies = []
	for i in range(k):
		n = scanner()
		sequence = get_list()
		summ = sum(sequence)
		for (j, s) in enumerate(sequence):
			trippies.append([summ - s, i + 1, j + 1])
	trippies.sort()
	for i in range(1, len(trippies)):
		if trippies[i][0] == trippies[i - 1][0] and trippies[i][1] != trippies[i - 1][1]:
			print('YES')
			print(trippies[i][1], trippies[i][2])
			print(trippies[i - 1][1], trippies[i - 1][2])
			return
	print('NO')
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')
for i in range(1):
	solve()


k = int(input())
seq = []
for i in range(k):
	n = int(input())
	(*a,) = map(int, input().split())
	seq.append(a)
from collections import Counter
sc = Counter()
seqsum = []
for a in seq:
	sa = sum(a)
	seqsum.append(set((sa - x for x in a)))
	for s in seqsum[-1]:
		sc[s] += 1
(s, c) = sc.most_common(1)[0]
if c > 1:
	print('YES')
	cnt = 0
	for i in range(k):
		if s in seqsum[i]:
			cnt += 1
			sa = sum(seq[i])
			for (j, x) in enumerate(seq[i]):
				if sa - x == s:
					print('{} {}'.format(i + 1, j + 1))
					break
			if cnt == 2:
				break
else:
	print('NO')


n = int(input().strip())
sm = {}
l = []
flag = False
x1 = 0
y1 = 0
x2 = 0
y2 = 0
for i in range(n):
	S = 0
	l.append(int(input().strip()))
	a = list(map(int, input().strip().split()))
	S += sum(a)
	for j in range(l[i]):
		if S - a[j] in sm:
			if i != sm[S - a[j]][0]:
				flag = True
				x1 = i + 1
				y1 = j + 1
				x2 = sm[S - a[j]][0] + 1
				y2 = sm[S - a[j]][1] + 1
				break
		else:
			sm[S - a[j]] = [i, j]
if flag:
	print('YES')
	print(str(x1) + ' ' + str(y1))
	print(str(x2) + ' ' + str(y2))
else:
	print('NO')


from sys import stdin
n = int(stdin.readline().rstrip().split()[0])
dictN = {}
end = False
for i in range(n):
	if end:
		break
	k = int(stdin.readline().rstrip().split()[0])
	numbers = stdin.readline().rstrip().split()
	numbers = list(map(int, numbers))
	sumN = sum(numbers)
	j = 0
	for number in numbers:
		if end:
			break
		numberAux = sumN - number
		if numberAux in dictN:
			if dictN[numberAux][0] != i:
				end = True
				print('YES')
				print(i + 1, end=' ')
				print(j + 1)
				print(dictN[numberAux][0] + 1, end=' ')
				print(dictN[numberAux][1] + 1)
		else:
			dictN[numberAux] = (i, j)
		j += 1
if not end:
	print('NO')


def main():
	k = int(input())
	data = [0] * k
	for i in range(k):
		input()
		data[i] = [int(x) for x in input().split(' ')]
	res = []
	for (i, arr) in enumerate(data):
		i += 1
		s = sum(arr)
		for (j, e) in enumerate(arr):
			j += 1
			res.append((s - e, i, j))
	res.sort()
	for i in range(len(res) - 1):
		if res[i][0] == res[i + 1][0] and res[i][1] != res[i + 1][1]:
			print('YES')
			print(res[i + 1][1], res[i + 1][2])
			print(res[i][1], res[i][2])
			exit()
	print('NO')
main()


n = int(input())
res = []
for i in range(n):
	m = int(input())
	arr = list(map(int, input().split()))
	s = sum(arr)
	for j in range(m):
		res.append((s - arr[j], i, j))
res.sort()
for i in range(len(res) - 1):
	if res[i][0] == res[i + 1][0] and res[i][1] != res[i + 1][1]:
		print('YES')
		print(res[i][1] + 1, res[i][2] + 1)
		print(res[i + 1][1] + 1, res[i + 1][2] + 1)
		exit()
print('NO')


def crt(lis, ind):
	global sup
	a = sum(lis)
	for x in range(si):
		sup.append((a - lis[x], ind, x + 1))
sup = []
for x in range(int(input())):
	si = int(input())
	crt(list(map(int, input().split())), x + 1)
sup.sort()
for x in range(1, len(sup)):
	if sup[x - 1][0] == sup[x][0] and sup[x - 1][1] != sup[x][1]:
		print('YES')
		print(sup[x - 1][1], sup[x - 1][2])
		print(sup[x][1], sup[x][2])
		exit()
print('NO')


import sys
k = int(input())
ns = []
seqs = []
for _ in range(k):
	ns.append(int(input()))
	seqs.append([int(a) for a in input().split()])
sums = [sum(s) for s in seqs]
removed_sums = {}
for i in range(k):
	for j in range(ns[i]):
		x = sums[i] - seqs[i][j]
		if x in removed_sums and removed_sums[x][0] != i:
			print('YES')
			print(i + 1, j + 1)
			(a, b) = removed_sums[x]
			print(a + 1, b + 1)
			sys.exit()
		else:
			removed_sums[x] = (i, j)
print('NO')


n = int(input())
bucket = {}
flag = True
for i in range(n):
	indexNum = int(input())
	tmp = [int(o) for o in input().split()]
	if not flag:
		continue
	tmpsum = sum(tmp)
	tmpBucket = {}
	for o in range(indexNum):
		tmpBucket[tmpsum - tmp[o]] = [i + 1, o + 1]
	for bucketSum in tmpBucket:
		if bucketSum in bucket:
			flag = False
			ans1 = tmpBucket[bucketSum]
			ans2 = bucket[bucketSum]
		else:
			bucket[bucketSum] = tmpBucket[bucketSum]
if flag:
	print('NO')
else:
	print('YES')
	print(' '.join([str(i) for i in ans1]))
	print(' '.join([str(i) for i in ans2]))


import sys
k = int(input())
ss = list()
ss_sum = list()

def is_int(v):
	try:
		int(v)
		return True
	except:
		return False
for i in range(k):
	n = int(input())
	arr = list(map(int, input().split()))
	c_sum = sum(arr)
	for (j, v) in enumerate(arr):
		ss_sum.append([c_sum - v, i, j])
ss = sorted(ss_sum, key=lambda x: x[0])
for i in range(len(ss) - 1):
	if ss[i][0] == ss[i + 1][0] and ss[i][1] != ss[i + 1][1]:
		print('YES')
		print(ss[i][1] + 1, ss[i][2] + 1)
		print(ss[i + 1][1] + 1, ss[i + 1][2] + 1)
		sys.exit()
print('NO')


import sys
k = int(input())
d = {}
a = []
for j in range(k):
	n = int(input())
	a.append([int(x) for x in input().split()])
	s = set(a[j])
	total = sum(a[j])
	for x in s:
		if total - x in d.keys():
			i = d[total - x]
			sum_i = sum(a[i])
			find = sum_i - (total - x)
			for k in range(len(a[i])):
				if a[i][k] == find:
					break
			print('YES')
			print(i + 1, k + 1)
			for k in range(len(a[j])):
				if a[j][k] == x:
					break
			print(j + 1, k + 1)
			sys.exit()
			break
		else:
			d[total - x] = j
print('NO')


k = int(input())
arr = []
arrx = []
for i in range(k):
	n = int(input())
	arr1 = list(map(int, input().split()))
	arrx.append(arr1)
	arr.append(n)
dict1 = {}
flag = 0
i = 0
dict2 = {}
while i < k and flag == 0:
	k1 = sum(arrx[i])
	for j in range(arr[i]):
		try:
			if dict1[k1 - arrx[i][j]] != i + 1:
				flag = 1
				print('YES')
				print(dict2[k1 - arrx[i][j]][0], dict2[k1 - arrx[i][j]][1])
				print(i + 1, j + 1)
				break
		except KeyError:
			dict1[k1 - arrx[i][j]] = i + 1
			dict2[k1 - arrx[i][j]] = [i + 1, j + 1]
	i += 1
if flag == 0:
	print('NO')


k = int(input())
trip = []
for _ in range(k):
	d1 = set()
	n = int(input())
	seq = [int(x) for x in input().split()]
	total = sum(seq)
	for i in range(len(seq)):
		if total - seq[i] not in d1:
			trip.append((total - seq[i], _, i))
		d1.add(total - seq[i])
trip.sort()
f = -1
for i in range(len(trip) - 1):
	if trip[i][0] == trip[i + 1][0]:
		if trip[i][1] != trip[i + 1][1]:
			print('YES')
			print(trip[i][1] + 1, trip[i][2] + 1)
			print(trip[i + 1][1] + 1, trip[i + 1][2] + 1)
			f = 1
			break
if f == -1:
	print('NO')


k = int(input())
array = []
for i in range(k):
	n = int(input())
	a = list(map(int, input().split()))
	sum1 = sum(a)
	for j in range(n):
		array.append([sum1 - a[j], i + 1, j + 1])
array.sort()
flag = 0
for i in range(1, len(array)):
	if array[i - 1][0] == array[i][0] and array[i - 1][1] != array[i][1]:
		flag = 1
		print('YES')
		print(array[i - 1][1], array[i - 1][2])
		print(array[i][1], array[i][2])
		break
if flag == 0:
	print('NO')


k = int(input())
res = []
t = []
flag = True
for i in range(k):
	n = int(input())
	res.append(list(map(int, input().split())))
for i in range(len(res)):
	a = sum(res[i])
	for j in range(len(res[i])):
		t.append((a - res[i][j], i, j))
t = sorted(t, key=lambda x: x[0])
for i in range(len(t) - 1):
	if t[i][0] == t[i + 1][0] and t[i][1] != t[i + 1][1]:
		print('YES')
		print(t[i][1] + 1, t[i][2] + 1)
		print(t[i + 1][1] + 1, t[i + 1][2] + 1)
		flag = False
		break
if flag:
	print('NO')


NedoSums = {}
for i in range(int(input())):
	input()
	a = list(map(int, input().split()))
	s = sum(a)
	TekSums = set()
	for j in range(len(a)):
		if a[j] not in TekSums:
			TekSums.add(a[j])
			Shliapa = NedoSums.get(s - a[j])
			if Shliapa is not None:
				print('YES')
				print(*Shliapa)
				print(i + 1, j + 1)
				exit()
			NedoSums[s - a[j]] = (i + 1, j + 1)
print('NO')


dict = {}
one = -1
for i in range(int(input())):
	n = int(input())
	if n == 1 and one < 0:
		one = i
	elif n == 1 and one:
		print('YES')
		print(i + 1, 1)
		print(one + 1, 1)
		exit()
	ar = [int(x) for x in input().split()]
	x = sum(ar)
	ar = [x - y for y in ar]
	for (ii, y) in enumerate(ar):
		if y in dict:
			(j, jj) = dict[y]
			if j == i:
				continue
			print('YES')
			print(i + 1, ii + 1)
			print(j + 1, jj + 1)
			exit()
		else:
			dict[y] = (i, ii)
print('NO')


n_seq = int(input())
sums = {}
for i in range(n_seq):
	seq_len = int(input())
	seq = list(map(int, input().split()))
	seq_sum = sum(seq)
	n_seq_sums = []
	for j in range(seq_len):
		n_seq_sum = seq_sum - seq[j]
		if n_seq_sum in sums:
			(i_, j_) = sums[n_seq_sum]
			print('YES')
			print(i + 1, j + 1)
			print(i_ + 1, j_ + 1)
			exit()
		n_seq_sums.append(n_seq_sum)
	for j in range(seq_len):
		sums[n_seq_sums[j]] = (i, j)
print('NO')


k = int(input())
d = {}
for i in range(1, k + 1):
	input()
	a = [int(x) for x in input().split()]
	s = sum(a)
	for (j, x) in enumerate(a, 1):
		if s - x in d and d[s - x][0] != i:
			print('YES')
			print(i, j)
			print(d[s - x][0], d[s - x][1])
			exit(0)
		else:
			d[s - x] = (i, j)
print('NO')


class elem:

	def __init__(self, val, ind, seq):
		self.val = val
		self.ind = ind
		self.seq = seq
k = int(input())
elemar = []
for w in range(k):
	n = int(input())
	arr = list(map(int, input().split()))
	suma = sum(arr)
	for i in range(n):
		arr[i] = suma - arr[i]
	for i in range(n):
		elemar.append(elem(arr[i], i + 1, w + 1))
elemar.sort(key=lambda elem: elem.val)
l = len(elemar)
flag = 0
for i in range(1, l):
	if elemar[i].val == elemar[i - 1].val and elemar[i].seq != elemar[i - 1].seq:
		flag = 1
		print('YES')
		print(elemar[i].seq, elemar[i].ind)
		print(elemar[i - 1].seq, elemar[i - 1].ind)
		break
if flag == 0:
	print('NO')


def f():
	d = {}
	k = int(input())
	l = []
	s = []
	for i in range(k):
		input()
		l.append(list(map(int, input().split())))
		s.append(sum(l[-1]))
	for i in range(len(l)):
		for j in range(len(l[i])):
			if not s[i] - l[i][j] in d:
				d[s[i] - l[i][j]] = (i, j)
			else:
				if i == d[s[i] - l[i][j]][0]:
					continue
				print('YES')
				print(i + 1, j + 1)
				print(d[s[i] - l[i][j]][0] + 1, d[s[i] - l[i][j]][1] + 1)
				return
	print('NO')
f()


k = int(input())
di = {}
for i in range(k):
	n = int(input())
	a = list(map(int, input().split()))
	s = sum(a)
	seen = set()
	for x in range(n):
		tmp = s - a[x]
		if tmp in seen:
			continue
		seen.add(tmp)
		if tmp not in di:
			di[tmp] = (i + 1, x + 1)
		else:
			print('YES')
			print(*di[tmp])
			print(i + 1, x + 1)
			exit(0)
print('NO')


from functools import reduce

def readInt():
	return int(input())

def readInts():
	return [int(x) for x in input().split(' ')]
k = readInt()
sequences = []
for i in range(0, k):
	n = readInt()
	seq = readInts()
	sequences.append(seq)
all = []
for (sequenceNumber, sequence) in enumerate(sequences):
	sum = reduce(lambda x, y: x + y, sequence, 0)
	for (elementNumber, element) in enumerate(sequence):
		all.append((sum - element, sequenceNumber, elementNumber))
all = sorted(all)
for i in range(0, len(all) - 1):
	e1 = all[i]
	e2 = all[i + 1]
	if e1[0] == e2[0] and e1[1] != e2[1]:
		print('YES')
		print(str(e1[1] + 1) + ' ' + str(e1[2] + 1))
		print(str(e2[1] + 1) + ' ' + str(e2[2] + 1))
		exit()
print('NO')


mydict = {}
num_seq = int(input())
for i in range(1, num_seq + 1):
	input()
	seq = list(map(int, input().split()))
	mysum = sum(seq)
	myset = set()
	for (ind, value) in enumerate(seq, start=1):
		if value not in myset:
			myset.add(value)
			if mydict.get(mysum - value, -1) != -1:
				print('YES')
				print(*mydict.get(mysum - value))
				print(i, ind)
				exit()
			else:
				mydict[mysum - value] = (i, ind)
print('NO')


import collections
N = int(input())
a = [N]
res1index = -1
res2index = -1
res1num = -1
res2num = -1
d = collections.OrderedDict()
for x in range(N):
	K = int(input())
	sums = [0] * K
	totalSum = 0
	inLine = list(map(int, input().split()))
	for i in range(K):
		sums[i] = -inLine[i]
		totalSum += inLine[i]
	answerFound = False
	for i in range(K):
		sums[i] += totalSum
		if sums[i] in d:
			if d[sums[i]][0] != x:
				res1index = x
				res2index = d[sums[i]][0]
				res1num = i
				res2num = d[sums[i]][1]
				answerFound = True
				break
		if not sums[i] in d:
			d[sums[i]] = (x, i)
if res1index != -1:
	print('YES')
	print(res1index + 1, ' ', res1num + 1)
	print(res2index + 1, ' ', res2num + 1)
else:
	print('NO')


k = int(input())
n = [0] * k
a = [0] * k
s = [0] * k
for i in range(k):
	n[i] = int(input())
	a[i] = list(map(int, input().split()))
	s[i] = sum(a[i])
d = {}
flag = 0
elt = 0
for i in range(k):
	if flag:
		break
	for j in a[i]:
		if s[i] - j in d and i not in d[s[i] - j]:
			d[s[i] - j].append(i)
			elt = s[i] - j
			flag = 1
			break
		else:
			d[s[i] - j] = [i]
if flag:
	(l1, l2) = d[elt]
	print('YES')
	print(l1 + 1, a[l1].index(s[l1] - elt) + 1)
	print(l2 + 1, a[l2].index(s[l2] - elt) + 1)
else:
	print('NO')


from sys import stdin, stdout
k = int(stdin.readline())
li = []
for i in range(k):
	n = int(stdin.readline())
	l = list(map(int, stdin.readline().split()))
	s = sum(l)
	for j in range(n):
		li.append([s - l[j], i + 1, j + 1])
li.sort()
for i in range(1, len(li)):
	if li[i][0] == li[i - 1][0] and li[i][1] != li[i - 1][1]:
		stdout.write('YES\n' + str(li[i - 1][1]) + ' ' + str(li[i - 1][2]) + '\n' + str(li[i][1]) + ' ' + str(li[i][2]))
		quit()
print('NO')


k = int(input())
b = set()
e = []
for i in range(k):
	n = int(input())
	a = list(map(int, input().split()))
	s = sum(a)
	c = []
	d = [s]
	for j in range(n):
		if s - a[j] in b:
			print('YES')
			print(i + 1, j + 1)
			for k in range(len(e)):
				for p in range(1, len(e[k])):
					if e[k][0] - e[k][p] == s - a[j]:
						print(k + 1, p)
						exit()
		else:
			c.append(s - a[j])
		d.append(a[j])
	for j in c:
		b.add(j)
	e.append(d)
print('NO')


k = int(input())
p = {}
for i in range(k):
	input()
	a = list(map(int, input().split()))
	s = sum(a)
	for (e, j) in enumerate(a):
		r = s - j
		if r in p and p[r][0] != i:
			print('YES')
			print(i + 1, e + 1)
			print(p[r][0] + 1, p[r][1] + 1)
			exit(0)
		else:
			p[r] = (i, e)
print('NO')


k = int(input())
t = k
triplets = []
array = []
count = 0
while k:
	h = int(input())
	arr = list(map(int, input().split()))
	summ = sum(arr)
	for j in range(len(arr)):
		new_sum = summ - arr[j]
		triplets.append((new_sum, count + 1, j + 1))
	count += 1
	k -= 1
flag = 0
triplets = sorted(triplets)
for i in range(1, len(triplets)):
	if triplets[i - 1][0] == triplets[i][0] and triplets[i - 1][1] != triplets[i][1]:
		print('YES')
		print(triplets[i - 1][1], triplets[i - 1][2])
		print(triplets[i][1], triplets[i][2])
		flag = 1
		break
if flag == 0:
	print('NO')


import sys
input = sys.stdin.readline
k = int(input())
d = {}
for i in range(k):
	n = int(input())
	a = list(map(int, input().split()))
	s = sum(a)
	for j in range(n):
		if s - a[j] in d and i != d[s - a[j]] // 10 ** 6:
			print('YES')
			print(i + 1, j + 1)
			k = d[s - a[j]] // 10 ** 6
			l = d[s - a[j]] % 10 ** 6
			print(k + 1, l + 1)
			exit()
		else:
			d[s - a[j]] = 10 ** 6 * i + j
print('NO')


n = int(input())
x = list()
for i in range(n):
	size = int(input())
	li = list(map(int, input().split()))
	add = sum(li)
	for j in range(size):
		x.append((add - li[j], i, j))
x = sorted(x)
for i in range(1, len(x)):
	if x[i][0] == x[i - 1][0] and x[i][1] != x[i - 1][1]:
		print('YES')
		print(x[i][1] + 1, x[i][2] + 1)
		print(x[i - 1][1] + 1, x[i - 1][2] + 1)
		exit()
print('NO')


k = int(input())
d = {}
for i in range(1, k + 1):
	n = int(input())
	a = list(map(int, input().split(' ')))
	Sum = sum(a)
	for j in range(1, n + 1):
		temp = Sum - a[j - 1]
		if temp in d:
			print('YES')
			print(i, j)
			print(d[temp][0], d[temp][1])
			exit()
	for j in range(1, n + 1):
		temp = Sum - a[j - 1]
		d[temp] = (i, j)
print('NO')


TN = 1

def solution():
	k = int(input())
	a = []
	l = []
	s = []
	ans = {}
	for i in range(k):
		a.append(int(input()))
		l.append(list(map(int, input().split())))
		s.append(sum(l[i]))
	otv = False
	sc = 0
	for i in range(k):
		if not otv:
			for j in range(a[i]):
				sl = s[i] - l[i][j]
				try:
					x = ans[sl]
				except:
					ans[sl] = i + 1
				else:
					if ans[sl] != i + 1:
						if not otv:
							otv = True
							y = -1
							for b in range(a[ans[sl] - 1]):
								if s[ans[sl] - 1] == sl + l[ans[sl] - 1][b]:
									y = b + 1
									break
							print('YES')
							print(i + 1, j + 1)
							print(ans[sl], y)
							sc = 1
	if not sc:
		print('NO')
while TN != 0:
	solution()
	TN -= 1


k = int(input())
l = {}
d = {}
for i in range(k):
	n = int(input())
	a = [int(x) for x in input().split()]
	s = sum(a)
	for j in range(n):
		e = s - a[j]
		if e not in l:
			l[e] = 1
			d[e] = [(i + 1, j + 1)]
		elif d[e][0][0] != i + 1:
			l[e] += 1
			d[s - a[j]].append((i + 1, j + 1))
			print('YES')
			print(d[e][0][0], d[e][0][1])
			print(d[e][1][0], d[e][1][1])
			exit(0)
print('NO')


total = {}
for i in range(int(input())):
	input()
	a = list(map(int, input().split()))
	s = sum(a)
	idx = {v: i for (i, v) in enumerate(a)}
	for v in set(a):
		p = idx[v]
		if s - v in total:
			(I, P) = total[s - v]
			print('YES')
			print(I + 1, P + 1)
			print(i + 1, p + 1)
			exit()
		else:
			total[s - v] = (i, p)
print('NO')


from functools import cmp_to_key
import sys

def getIntList():
	return list(map(int, input().split()))
n = int(input())
z = {}
for i in range(n):
	k = int(input())
	nz = getIntList()
	s = sum(nz)
	y = {}
	for j in range(k):
		t = s - nz[j]
		if t in z:
			print('YES')
			print(z[t][0], z[t][1])
			print(i + 1, j + 1)
			sys.exit()
		y[t] = (i + 1, j + 1)
	z.update(y)
print('NO')


import sys
input = lambda : sys.stdin.readline()
MOD = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : list(map(int, input().split()))
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
d = dict()
for ind in range(ii()):
	n = ii()
	l = il()
	sm = sum(l)
	for i in range(n):
		if not sm - l[i] in d:
			d[sm - l[i]] = [[ind + 1, i + 1]]
		elif d[sm - l[i]][-1][0] != ind + 1:
			print('YES')
			print(*d[sm - l[i]][-1])
			print(ind + 1, i + 1)
			exit()
		else:
			d[sm - l[i]].append([ind + 1, i + 1])
print('NO')


def same_sums():
	n = int(input())
	allarrs = []
	for i in range(n):
		input()
		sequence = list(map(int, input().split()))
		s = sum(sequence)
		for element in range(len(sequence)):
			sminusel = s - sequence[element]
			allarrs.append((i + 1, sminusel, element + 1))
	allarrs.sort(key=lambda x: x[1])
	m = len(allarrs)
	for i in range(1, m):
		if allarrs[i - 1][1] == allarrs[i][1] and allarrs[i - 1][0] != allarrs[i][0]:
			print('YES')
			print(allarrs[i - 1][0], allarrs[i - 1][2])
			print(allarrs[i][0], allarrs[i][2])
			return 1
	print('NO')
	return 0
same_sums()


from sys import stdin, exit

def listinput():
	return list(map(int, stdin.readline().rstrip().split()))
n = int(input())
inp = []
sums = []
for _ in range(n):
	_ = int(input())
	li = listinput()
	sums.append(sum(li))
	inp.append(li)
vals = {}
seen = [set() for _ in range(n)]
for i in range(n):
	for j in range(len(inp[i])):
		v = sums[i] - inp[i][j]
		if v not in vals:
			vals[v] = [(i + 1, j + 1)]
			seen[i].add(v)
		elif v not in seen[i]:
			print('YES')
			print(vals[v][0][0], vals[v][0][1])
			print(i + 1, j + 1)
			exit(0)
print('NO')


amount = int(input())
thirds = []
for i in range(amount):
	_ = int(input())
	array = [int(s) for s in input().split()]
	sum_ = sum(array)
	for j in range(len(array)):
		thirds.append((sum_ - array[j], i, j))
thirds = sorted(thirds)
flag = False
for i in range(len(thirds) - 1):
	if thirds[i][0] == thirds[i + 1][0] and thirds[i][1] != thirds[i + 1][1]:
		ans_1 = (thirds[i][1] + 1, thirds[i][2] + 1)
		ans_2 = (thirds[i + 1][1] + 1, thirds[i + 1][2] + 1)
		flag = True
		break
if flag:
	print('YES')
	print(' '.join([str(s) for s in ans_1]))
	print(' '.join([str(s) for s in ans_2]))
else:
	print('NO')


n = int(input())
l = []
t = {}
r = 0
for i in range(n):
	f = int(input())
	s = input()
	s = [int(i) for i in s.split()]
	e = sum(s)
	vis = set()
	for j in range(f):
		if e - s[j] in t and (not e - s[j] in vis):
			r = 1
			print('YES')
			print(i + 1, j + 1)
			print(t[e - s[j]][0], t[e - s[j]][1])
			break
		else:
			t[e - s[j]] = [i + 1, j + 1]
		vis.add(e - s[j])
	if r == 1:
		break
if r == 0:
	print('NO')