#include<iostream>
#include<vector>
#include<map>
using namespace std;

int main() {
	int k;
	while (cin >> k) {
		int n, flag = 0;
		map<int, pair<int, int>> loc;//注意键和值数据类型
		for (int i = 0; i < k; i++) {
			vector<int> nums;
			long long int sum = 0;
			cin >> n;
			for (int j = 0; j < n; j++) {
				int num;
				cin >> num;
				if (flag)continue;//正确答案已经输出，跳过
				nums.push_back(num);
				sum += num;
			}
			if (flag)continue;//正确答案已经输出，跳过
			for (int j = 0; j < n; j++) {
				nums[j] = sum - nums[j];
				if (loc.find(nums[j]) == loc.end()) loc[nums[j]] = make_pair(i, j);//注意插入方法
				else if (loc[nums[j]].first != i) {
					cout << "YES" << endl;
					cout << loc[nums[j]].first + 1 << " " << loc[nums[j]].second + 1 << endl;
					cout << i + 1 << " " << j + 1 << endl;
					flag = 1;
					break;
				}
			}
		}
		if (!flag)cout << "NO" << endl;
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;

const int maxn = 200010;

int main() {
	int k;
	while (cin >> k) {
		int n, flag = 0;
		map<long long int, pair<int, int>> loc;
		for (int i = 0; i < k; i++) {
			vector<long long int> nums;
			long long int sum = 0;
			cin >> n;
			for (int j = 0; j < n; j++) {
				int num;
				cin >> num;
				nums.push_back(num);
				sum += num;
			}
			for (int j = 0; j < n; j++) {
				nums[j] = sum - nums[j];
				if (loc.find(nums[j]) == loc.end()) { loc[nums[j]] = make_pair(i, j); }
				else if (loc[nums[j]].first != i) {
					cout << "YES" << endl;
					cout << loc[nums[j]].first + 1 << " " << loc[nums[j]].second + 1 << endl;
					cout << i + 1 << " " << j + 1 << endl;
					flag = 1;
					break;
				}
			}
			//if (flag)break;
		}
		if (!flag)cout << "NO" << endl;
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;

const int maxn = 200010;

int main() {
	int k;
	while (cin >> k) {
		int n, flag = 0;
		map<int, pair<int, int>> loc;
		for (int i = 0; i < k; i++) {
			vector<int> nums;
			long long int sum = 0;
			cin >> n;
			for (int j = 0; j < n; j++) {
				int num;
				cin >> num;
				if (flag)continue;
				nums.push_back(num);
				sum += num;
			}
			if (flag)continue;
			for (int j = 0; j < n; j++) {
				nums[j] = sum - nums[j];
				if (loc.find(nums[j]) == loc.end()) { loc[nums[j]] = make_pair(i, j); }
				else if (loc[nums[j]].first != i) {
					cout << "YES" << endl;
					cout << loc[nums[j]].first + 1 << " " << loc[nums[j]].second + 1 << endl;
					cout << i + 1 << " " << j + 1 << endl;
					flag = 1;
					break;
				}
			}
		}
		if (!flag)cout << "NO" << endl;
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;

const int maxn = 200010;

int main() {
	int k;
	while (cin >> k) {
		int n, flag = 0;
		map<int, pair<int, int>> loc;
		for (int i = 0; i < k; i++) {
			vector<int> nums;
			int sum = 0;
			cin >> n;
			for (int j = 0; j < n; j++) {
				int num;
				cin >> num;
				nums.push_back(num);
				sum += num;
			}
			for (int j = 0; j < n; j++) {
				nums[j] = sum - nums[j];
				if (loc.find(nums[j]) == loc.end()) { loc[nums[j]] = make_pair(i, j); }
				else if (loc[nums[j]].first != i) {
					cout << "YES" << endl;
					cout << loc[nums[j]].first + 1 << " " << loc[nums[j]].second + 1 << endl;
					cout << i + 1 << " " << j + 1 << endl;
					flag = 1;
					break;
				}
			}
			if (flag)break;
		}
		if (!flag)cout << "NO" << endl;
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cstring>
#include<set>
using namespace std;

const int maxn = 20000;
const int maxn2 = 500;

typedef struct point {
	int i, j, v;
}point;

int func(point a, point b) {
	return a.v == b.v;
}

int cmp(point a, point b) {
	return a.v > b.v;
}

int sums[maxn], ni[maxn];

int main() {
	int k;
	while (cin >> k) {
		vector<point> pos;
		memset(sums, 0, sizeof(sums));
		memset(ni, 0, sizeof(ni));
		int nums[maxn][maxn2];
		int flag = 0;
		for (int i = 0; i < k; i++) {
			cin >> ni[i];
			if (!i) {
				for (int j = 0; j < ni[i]; j++) {
					cin >> nums[i][j];
					sums[i] += nums[i][j];
				}
				for (int j = 0; j < ni[i]; j++) {
					nums[i][j] = sums[i] - nums[i][j];
					point temp;
					temp.i = i;
					temp.j = j;
					temp.v = nums[i][j];
					pos.push_back(temp);
				}
				sort(pos.begin(), pos.end(), cmp);
				pos.erase(unique(pos.begin(), pos.end(), func), pos.end());
			}
			else {
				for (int j = 0; j < ni[i]; j++) {
					cin >> nums[i][j];
					sums[i] += nums[i][j];
				}
				for (int j = 0; j < ni[i]; j++) {
					nums[i][j] = sums[i] - nums[i][j];
					for (int d = 0; d < pos.size(); d++) {
						if (nums[i][j] == pos[d].v&&pos[d].i != i) {
							flag = 1;
							cout << "YES" << endl;
							cout << i + 1 << " " << j + 1 << endl;
							cout << pos[d].i + 1 << " " << pos[d].j + 1 << endl;
							break;
						}
					}
					if (!flag) {
						point temp;
						temp.i = i;
						temp.j = j;
						temp.v = nums[i][j];
						pos.push_back(temp);
					}
					else break;
				}
			}
			if (flag)break;
		}
		if (!flag)cout << "NO" << endl;
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;

const int maxn = 200010;

int main() {
	int k;
	while (cin >> k) {
		int n, flag = 0;
		map<int, pair<int, int>> loc;
		for (int i = 0; i < k; i++) {
			vector<int> nums;
			long long int sum = 0;
			cin >> n;
			for (int j = 0; j < n; j++) {
				int num;
				cin >> num;
				nums.push_back(num);
				sum += num;
			}
			for (int j = 0; j < n; j++) {
				nums[j] = sum - nums[j];
				if (loc.find(nums[j]) == loc.end()) { loc[nums[j]] = make_pair(i, j); }
				else if (loc[nums[j]].first != i) {
					cout << "YES" << endl;
					cout << loc[nums[j]].first + 1 << " " << loc[nums[j]].second + 1 << endl;
					cout << i + 1 << " " << j + 1 << endl;
					flag = 1;
					break;
				}
			}
			if (flag)break;
		}
		if (!flag)cout << "NO" << endl;
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cstring>
#include<set>
using namespace std;

const int maxn = 200000;
const int maxn2 = 500;

typedef struct point {
	int i, j, v;
}point;

int func(point a, point b) {
	return a.v == b.v;
}

int cmp(point a, point b) {
	return a.v > b.v;
}

int sums[maxn], ni[maxn];

int main() {
	int k;
	while (cin >> k) {
		vector<point> pos;
		memset(sums, 0, sizeof(sums));
		memset(ni, 0, sizeof(ni));
		int nums[maxn][maxn2];
		int flag = 0;
		for (int i = 0; i < k; i++) {
			cin >> ni[i];
			if (!i) {
				for (int j = 0; j < ni[i]; j++) {
					cin >> nums[i][j];
					sums[i] += nums[i][j];
				}
				for (int j = 0; j < ni[i]; j++) {
					nums[i][j] = sums[i] - nums[i][j];
					point temp;
					temp.i = i;
					temp.j = j;
					temp.v = nums[i][j];
					pos.push_back(temp);
				}
				sort(pos.begin(), pos.end(), cmp);
				pos.erase(unique(pos.begin(), pos.end(), func), pos.end());
			}
			else {
				for (int j = 0; j < ni[i]; j++) {
					cin >> nums[i][j];
					sums[i] += nums[i][j];
				}
				for (int j = 0; j < ni[i]; j++) {
					nums[i][j] = sums[i] - nums[i][j];
					for (int d = 0; d < pos.size(); d++) {
						if (nums[i][j] == pos[d].v&&pos[d].i != i) {
							flag = 1;
							cout << "YES" << endl;
							cout << i + 1 << " " << j + 1 << endl;
							cout << pos[d].i + 1 << " " << pos[d].j + 1 << endl;
							break;
						}
					}
					if (!flag) {
						point temp;
						temp.i = i;
						temp.j = j;
						temp.v = nums[i][j];
						pos.push_back(temp);
					}
					else break;
				}
			}
			if (flag)break;
		}
		if (!flag)cout << "NO" << endl;
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;

const int maxn = 200010;

int main() {
	int k;
	while (cin >> k) {
		int n, flag = 0;
		map<long long int, pair<int, int>> loc;
		for (int i = 0; i < k; i++) {
			vector<long long int> nums;
			long long int sum = 0;
			cin >> n;
			for (int j = 0; j < n; j++) {
				int num;
				cin >> num;
				if (flag)continue;
				nums.push_back(num);
				sum += num;
			}
			if (flag)continue;
			for (int j = 0; j < n; j++) {
				nums[j] = sum - nums[j];
				if (loc.find(nums[j]) == loc.end()) { loc[nums[j]] = make_pair(i, j); }
				else if (loc[nums[j]].first != i) {
					cout << "YES" << endl;
					cout << loc[nums[j]].first + 1 << " " << loc[nums[j]].second + 1 << endl;
					cout << i + 1 << " " << j + 1 << endl;
					flag = 1;
					break;
				}
			}
		}
		if (!flag)cout << "NO" << endl;
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cstring>
#include<set>
using namespace std;

const int maxn = 200000;
const int maxn2 = 20;

typedef struct point {
	int i, j, v;
}point;

int func(point a, point b) {
	return a.v == b.v;
}

int cmp(point a, point b) {
	return a.v > b.v;
}

int sums[maxn], ni[maxn];

int main() {
	int k;
	while (cin >> k) {
		vector<point> pos;
		memset(sums, 0, sizeof(sums));
		memset(ni, 0, sizeof(ni));
		int nums[maxn][maxn2];
		int flag = 0;
		for (int i = 0; i < k; i++) {
			cin >> ni[i];
			if (!i) {
				for (int j = 0; j < ni[i]; j++) {
					cin >> nums[i][j];
					sums[i] += nums[i][j];
				}
				for (int j = 0; j < ni[i]; j++) {
					nums[i][j] = sums[i] - nums[i][j];
					point temp;
					temp.i = i;
					temp.j = j;
					temp.v = nums[i][j];
					pos.push_back(temp);
				}
				sort(pos.begin(), pos.end(), cmp);
				pos.erase(unique(pos.begin(), pos.end(), func), pos.end());
			}
			else {
				for (int j = 0; j < ni[i]; j++) {
					cin >> nums[i][j];
					sums[i] += nums[i][j];
				}
				for (int j = 0; j < ni[i]; j++) {
					nums[i][j] = sums[i] - nums[i][j];
					for (int d = 0; d < pos.size(); d++) {
						if (nums[i][j] == pos[d].v&&pos[d].i != i) {
							flag = 1;
							cout << "YES" << endl;
							cout << i + 1 << " " << j + 1 << endl;
							cout << pos[d].i + 1 << " " << pos[d].j + 1 << endl;
							break;
						}
					}
					if (!flag) {
						point temp;
						temp.i = i;
						temp.j = j;
						temp.v = nums[i][j];
						pos.push_back(temp);
					}
					else break;
				}
			}
			if (flag)break;
		}
		if (!flag)cout << "NO" << endl;
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cstring>
#include<set>
using namespace std;

const int maxn = 200000;
const int maxn2 = 1000;

typedef struct point {
	int i, j, v;
}point;

int func(point a, point b) {
	return a.v == b.v;
}

int cmp(point a, point b) {
	return a.v > b.v;
}

int sums[maxn], ni[maxn];

int main() {
	int k;
	while (cin >> k) {
		vector<point> pos;
		memset(sums, 0, sizeof(sums));
		memset(ni, 0, sizeof(ni));
		int nums[maxn][maxn2];
		int flag = 0;
		for (int i = 0; i < k; i++) {
			cin >> ni[i];
			if (!i) {
				for (int j = 0; j < ni[i]; j++) {
					cin >> nums[i][j];
					sums[i] += nums[i][j];
				}
				for (int j = 0; j < ni[i]; j++) {
					nums[i][j] = sums[i] - nums[i][j];
					point temp;
					temp.i = i;
					temp.j = j;
					temp.v = nums[i][j];
					pos.push_back(temp);
				}
				sort(pos.begin(), pos.end(), cmp);
				pos.erase(unique(pos.begin(), pos.end(), func), pos.end());
			}
			else {
				for (int j = 0; j < ni[i]; j++) {
					cin >> nums[i][j];
					sums[i] += nums[i][j];
				}
				for (int j = 0; j < ni[i]; j++) {
					nums[i][j] = sums[i] - nums[i][j];
					for (int d = 0; d < pos.size(); d++) {
						if (nums[i][j] == pos[d].v&&pos[d].i != i) {
							flag = 1;
							cout << "YES" << endl;
							cout << i + 1 << " " << j + 1 << endl;
							cout << pos[d].i + 1 << " " << pos[d].j + 1 << endl;
							break;
						}
					}
					if (!flag) {
						point temp;
						temp.i = i;
						temp.j = j;
						temp.v = nums[i][j];
						pos.push_back(temp);
					}
					else break;
				}
			}
			if (flag)break;
		}
		if (!flag)cout << "NO" << endl;
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cstring>
#include<set>
using namespace std;

const int maxn = 200000;
const int maxn2 = 200;

typedef struct point {
	int i, j, v;
}point;

int func(point a, point b) {
	return a.v == b.v;
}

int cmp(point a, point b) {
	return a.v > b.v;
}

int sums[maxn], ni[maxn];

int main() {
	int k;
	while (cin >> k) {
		vector<point> pos;
		memset(sums, 0, sizeof(sums));
		memset(ni, 0, sizeof(ni));
		int nums[maxn][maxn2];
		int flag = 0;
		for (int i = 0; i < k; i++) {
			cin >> ni[i];
			if (!i) {
				for (int j = 0; j < ni[i]; j++) {
					cin >> nums[i][j];
					sums[i] += nums[i][j];
				}
				for (int j = 0; j < ni[i]; j++) {
					nums[i][j] = sums[i] - nums[i][j];
					point temp;
					temp.i = i;
					temp.j = j;
					temp.v = nums[i][j];
					pos.push_back(temp);
				}
				sort(pos.begin(), pos.end(), cmp);
				pos.erase(unique(pos.begin(), pos.end(), func), pos.end());
			}
			else {
				for (int j = 0; j < ni[i]; j++) {
					cin >> nums[i][j];
					sums[i] += nums[i][j];
				}
				for (int j = 0; j < ni[i]; j++) {
					nums[i][j] = sums[i] - nums[i][j];
					for (int d = 0; d < pos.size(); d++) {
						if (nums[i][j] == pos[d].v&&pos[d].i != i) {
							flag = 1;
							cout << "YES" << endl;
							cout << i + 1 << " " << j + 1 << endl;
							cout << pos[d].i + 1 << " " << pos[d].j + 1 << endl;
							break;
						}
					}
					if (!flag) {
						point temp;
						temp.i = i;
						temp.j = j;
						temp.v = nums[i][j];
						pos.push_back(temp);
					}
					else break;
				}
			}
			if (flag)break;
		}
		if (!flag)cout << "NO" << endl;
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;

const int maxn = 200010;

int main() {
	int k;
	while (cin >> k) {
		int n, flag = 0;
		map<int, pair<int, int>> loc;
		for (int i = 0; i < k; i++) {
			vector<int> nums;
			long long int sum = 0;
			cin >> n;
			for (int j = 0; j < n; j++) {
				int num;
				cin >> num;
				nums.push_back(num);
				sum += num;
			}
			for (int j = 0; j < n; j++) {
				nums[j] = sum - nums[j];
				if (loc.find(nums[j]) == loc.end()) { loc[nums[j]] = make_pair(i, j); }
				else if (loc[nums[j]].first != i) {
					cout << "YES" << endl;
					cout << loc[nums[j]].first + 1 << " " << loc[nums[j]].second + 1 << endl;
					cout << i + 1 << " " << j + 1 << endl;
					flag = 1;
					break;
				}
			}
			//if (flag)break;
		}
		if (!flag)cout << "NO" << endl;
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cstring>
#include<set>
using namespace std;

const int maxn = 200000;
const int maxn2 = 2000;

typedef struct point {
	int i, j, v;
}point;

int func(point a, point b) {
	return a.v == b.v;
}

int cmp(point a, point b) {
	return a.v > b.v;
}

int sums[maxn], ni[maxn];

int main() {
	int k;
	while (cin >> k) {
		vector<point> pos;
		memset(sums, 0, sizeof(sums));
		memset(ni, 0, sizeof(ni));
		int nums[maxn][maxn2];
		int flag = 0;
		for (int i = 0; i < k; i++) {
			cin >> ni[i];
			if (!i) {
				for (int j = 0; j < ni[i]; j++) {
					cin >> nums[i][j];
					sums[i] += nums[i][j];
				}
				for (int j = 0; j < ni[i]; j++) {
					nums[i][j] = sums[i] - nums[i][j];
					point temp;
					temp.i = i;
					temp.j = j;
					temp.v = nums[i][j];
					pos.push_back(temp);
				}
				sort(pos.begin(), pos.end(), cmp);
				pos.erase(unique(pos.begin(), pos.end(), func), pos.end());
			}
			else {
				for (int j = 0; j < ni[i]; j++) {
					cin >> nums[i][j];
					sums[i] += nums[i][j];
				}
				for (int j = 0; j < ni[i]; j++) {
					nums[i][j] = sums[i] - nums[i][j];
					for (int d = 0; d < pos.size(); d++) {
						if (nums[i][j] == pos[d].v&&pos[d].i != i) {
							flag = 1;
							cout << "YES" << endl;
							cout << i + 1 << " " << j + 1 << endl;
							cout << pos[d].i + 1 << " " << pos[d].j + 1 << endl;
							break;
						}
					}
					if (!flag) {
						point temp;
						temp.i = i;
						temp.j = j;
						temp.v = nums[i][j];
						pos.push_back(temp);
					}
					else break;
				}
			}
			if (flag)break;
		}
		if (!flag)cout << "NO" << endl;
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<cstring>

#define f first
#define s second

using namespace std;

set<int> s[2*100002];
map<int, int> p[2*100002];

int main(){

    int t;
    cin >> t;

    vector<pair<int, int> > v(t+1);

    for(int i = 1; i <= t; i++){
        int n;
        cin >> n;
        int sum  = 0;
        for(int j = 0; j < n; j++){
            int x; cin >> x;
            p[i][x] = j+1;
            s[i].insert(x);
            sum += x;
         }

        v[i] = make_pair(sum,i);
       }

     sort(v.begin() + 1, v.end());

     int x, y;
     int id, jd;
     bool check = false;

     for(int i = 1; i < t; i++){

         for(int j = i+1; j <= t; j++){

              int tmp = v[j].f - v[i].f;

              for(set<int>::iterator it = s[i].begin(); it != s[i].end(); it++){
                       int q = (*it) - tmp;
                       if(s[j].count(q)){
                            x = *it;
                            y = q;
                            jd = v[i].s;
                            id = v[j].s;
                            check = true;
                            break;
                         }
                    }

            if(check){
                break;
            }

         }
        if(check){
            break;
        }
     }

     if(check){

        cout << "YES" << '\n';
        cout << id << " " << p[id][x] << '\n';
        cout << jd << " " << p[jd][y] << '\n';

     }
     else{
       cout << "NO";
     }

    return 0;
}


#include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<cstring>

#define f first
#define s second

using namespace std;

set<int> s[2*100002];
map<int, int> p[2*100002];

int main(){

    int t;
    cin >> t;

    vector<pair<int, int> > v;

    for(int i = 1; i <= t; i++){
        int n;
        cin >> n;
        int sum  = 0;
        for(int j = 0; j < n; j++){
            int x; cin >> x;
            p[i][x] = j+1;
            s[i].insert(x);
            sum += x;
         }

        v.push_back(make_pair(sum, i));
     }

     sort(v.begin(), v.end());

     int x, y;
     int id, jd;
     bool check = false;

     for(int i = 1; i < t; i++){

         for(int j = i+1; j <= t; j++){

              int tmp = v[j-1].f - v[i-1].f;

              for(set<int>::iterator it = s[i].begin(); it != s[i].end(); it++){
                       int q = tmp - (*it);
                       if(s[j].count(q)){
                            x = *it;
                            y = q;
                            cout << y << endl;
                            id = v[i-1].s;
                            jd = v[j-1].s;
                            check = true;
                            break;
                        }
               }

            if(check){
                break;
            }

         }
        if(check){
            break;
        }
     }

     if(check){

        cout << "YES" << '\n';
        cout << id << " " << p[id][x] << '\n';
        cout << jd << " " << p[jd][y] << '\n';

     }
     else{
       cout << "NO";
     }

    return 0;
}


#include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<cstring>

#define f first
#define s second

using namespace std;

set<int> s[2*100002];
map<int, int> p[2*100002];

int main(){

    int t;
    cin >> t;

    vector<pair<int, int> > v(t+1);

    for(int i = 1; i <= t; i++){
        int n;
        cin >> n;
        int sum  = 0;
        for(int j = 0; j < n; j++){
            int x; cin >> x;
            p[i][x] = j+1;
            s[i].insert(x);
            sum += x;
         }

        v[i] = make_pair(sum,i);
       }

     sort(v.begin() + 1, v.end());

     int x, y;
     int id, jd;
     bool check = false;

     for(int i = 1; i <= t; i++){
         for(int j = 1; j <= t ; j++){

              if(j == i) continue;

              int tmp = v[j].f - v[i].f;

              for(set<int>::iterator it = s[i].begin(); it != s[i].end(); it++){
                       int q = (*it) - tmp;
                       if(s[j].count(q)){
                            x = *it;
                            y = q;
                            jd = v[i].s;
                            id = v[j].s;
                            check = true;
                            break;
                         }
                    }

            if(check){
                break;
            }

         }
        if(check){
            break;
        }
     }

     if(check){

        cout << "YES" << '\n';
        cout << id << " " << p[id][x] << '\n';
        cout << jd << " " << p[jd][y] << '\n';

     }
     else{
       cout << "NO";
     }

    return 0;
}


#include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<cstring>

#define f first
#define s second

using namespace std;

vector<int> v[2*100003];

int main(){

    int t;
    cin >> t;

    vector<pair<int, pair<int, int> > > a;
    int b[t];

    for(int i = 0; i < t; i++){
         int n;
         cin >> n;

         int sum = 0;

         for(int j = 0; j < n; j++){
              int x; cin >> x;
              v[i].push_back(x);
              sum += x;
            }

         b[i] = sum;
        }

     for(int i = 0; i < t; i++){
         for(int j = 0; j < v[i].size(); j++){
               a.push_back(make_pair(b[i] - v[i][j], make_pair(i, j+1)));
             }
          }

     sort(a.begin(), a.end());

     for(int i = 1; i < a.size(); i++){
           if(a[i].f == a[i-1].f){
                if(a[i].s.f != a[i-1].s.f){
                    cout << "YES" << '\n';
                    cout << a[i].s.f + 1 << " " << a[i].s.s  << '\n';
                    cout << a[i-1].s.f + 1 << " " << a[i-1].s.s << '\n';
                    return 0;
                }
            }
        }

    cout << "NO";

    return 0;
}


#include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<cstring>

#define f first
#define s second

using namespace std;

set<int> s[2*100002];

int main(){

    int t;
    cin >> t;

    vector<pair<int, int> > v;

    for(int i = 1; i <= t; i++){
        int n;
        cin >> n;
        int sum  = 0;
        for(int j = 0; j < n; j++){
            int x; cin >> x;
            s[i].insert(x);
            sum += x;
         }

        v.push_back(make_pair(sum, i));
     }

     sort(v.begin(), v.end());

     int x, y;
     int id, jd;
     bool check = false;

     for(int i = 1; i < t; i++){

         for(int j = i+1; j <= t; j++){

              int tmp = v[j-1].f - v[i-1].f;

              for(set<int>::iterator it = s[i].begin(); it != s[i].end(); it++){
                       int q = tmp - *it;
                       if(s[j].count(q)){
                            x = *it;
                            y = q;
                            id = v[i-1].s;
                            jd = v[j-1].s;
                            check = true;
                            break;
                        }
               }

            if(check){
                break;
            }

         }
        if(check){
            break;
        }
     }

     if(check){

        cout << "YES" << '\n';
        cout << id << " " << x << '\n';
        cout << jd << " " << y << '\n';

     }
     else{
       cout << "NO";
     }

    return 0;
}


#include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<cstring>

#define f first
#define s second

using namespace std;

set<int> s[2*100002];
map<int, int> p[2*100002];

int main(){

    int t;
    cin >> t;

    vector<pair<int, int> > v;

    for(int i = 1; i <= t; i++){
        int n;
        cin >> n;
        int sum  = 0;
        for(int j = 0; j < n; j++){
            int x; cin >> x;
            p[i][x] = j+1;
            s[i].insert(x);
            sum += x;
         }

        v.push_back(make_pair(sum, i));
     }

     sort(v.begin(), v.end());

     int x, y;
     int id, jd;
     bool check = false;

     for(int i = 1; i < t; i++){

         for(int j = i+1; j <= t; j++){

              int tmp = v[j-1].f - v[i-1].f;

              for(set<int>::iterator it = s[i].begin(); it != s[i].end(); it++){
                       int q = tmp - (*it);
                       if(s[j].count(q)){
                            x = *it;
                            y = q;
                            id = v[i-1].s;
                            jd = v[j-1].s;
                            check = true;
                            break;
                        }
               }

            if(check){
                break;
            }

         }
        if(check){
            break;
        }
     }

     if(check){

        cout << "YES" << '\n';
        cout << id << " " << p[id][x] << '\n';
        cout << jd << " " << p[jd][y] << '\n';

     }
     else{
       cout << "NO";
     }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define mod 1000000007

int main()
{
	vector< pair<ll,ll> > pos[700000];
	vector< pair<ll,ll> > neg[700000];
	ll k,i,j;
	cin>>k;
	pair<ll,ll> ans1,ans2;
	ll fnd=0;
	for(i=1;i<=k;i++)
	{
		ll n,m,x,y,sum=0,z;
		cin>>n;
		ll a[n]={};
		for(j=1;j<=n;j++)
		{
			cin>>a[j];
			sum+=a[j];
		}

		if(fnd==0)
		{

		map<ll,ll> mp;
		pair<ll,ll> pr;

		for(j=1;j<n && fnd==0;j++)
		{
			if(mp[a[j]]==0)
			{
				pr.first=i;
				x=sum-a[j];
				pr.second=j;
				if(x>=0)
				{
					if(pos[x].size()>0)
					{
						//cout<<"SUM:"<<x<<"\n";
						fnd=1;
						ans1=pr;
						ans2=pos[x][0];
					}
					else
					{
						pos[x].push_back(pr);
					}
				}
				else
				{
					x=-x;
					if(neg[x].size()>0)
					{
						fnd=1;
						ans1=pr;
						ans2=neg[x][0];
					}
					else
					{
						neg[x].push_back(pr);
					}
				}
			}
			mp[a[j]]++;
		}

		}

	}

	if(fnd==0)
	{
		cout<<"NO\n";
	}
	else
	{
		cout<<"YES\n";
		cout<<ans1.first<<" "<<ans1.second<<"\n";
		cout<<ans2.first<<" "<<ans2.second<<"\n";
	}

}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define mod 1000000007

int main()
{
	vector< pair<ll,ll> > pos[200000];
	vector< pair<ll,ll> > neg[200000];
	ll k,i,j;
	cin>>k;
	pair<ll,ll> ans1,ans2;
	ll fnd=0;
	for(i=1;i<=k;i++)
	{
		ll n,m,x,y,sum=0,z;
		cin>>n;
		ll a[n]={};
		for(j=1;j<=n;j++)
		{
			cin>>a[j];
			sum+=a[j];
		}

		if(fnd==0)
		{

		map<ll,ll> mp;
		pair<ll,ll> pr;

		for(j=1;j<n && fnd==0;j++)
		{
			if(mp[a[j]]==0)
			{
				pr.first=i;
				x=sum-a[j];
				pr.second=j;
				if(x>=0)
				{
					if(pos[x].size()>0)
					{
						//cout<<"SUM:"<<x<<"\n";
						fnd=1;
						ans1=pr;
						ans2=pos[x][0];
					}
					else
					{
						pos[x].push_back(pr);
					}
				}
				else
				{
					x=-x;
					if(neg[x].size()>0)
					{
						fnd=1;
						ans1=pr;
						ans2=neg[x][0];
					}
					else
					{
						neg[x].push_back(pr);
					}
				}
			}
			mp[a[j]]++;
		}

		}

	}

	if(fnd==0)
	{
		cout<<"NO\n";
	}
	else
	{
		cout<<"YES\n";
		cout<<ans1.first<<" "<<ans1.second<<"\n";
		cout<<ans2.first<<" "<<ans2.second<<"\n";
	}

}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define mod 1000000007

int main()
{
	map<ll, pair<ll,ll> > don;
	ll k,i,j;
	cin>>k;
	pair<ll,ll> ans1,ans2;
	ll fnd=0;
	for(i=1;i<=k;i++)
	{
		ll n,m,x,y,sum=0,z;
		cin>>n;
		ll a[n]={};
		for(j=1;j<=n;j++)
		{
			cin>>a[j];
			sum+=a[j];
		}

		if(fnd==0)
		{

		map<ll,ll> mp;
		pair<ll,ll> pr,tr;

		for(j=1;j<n && fnd==0;j++)
		{
			if(mp[a[j]]==0)
			{
				pr.first=i;
				x=sum-a[j];
				pr.second=j;
				tr=don[x];
				if(tr.first!=0 && tr.second!=0)
				{
					fnd=1;
					ans1=tr;
					ans2=pr;
				}
				else
				{
					don[x]=pr;
				}
			}
			mp[a[j]]++;
		}

		}

	}

	if(fnd==0)
	{
		cout<<"NO\n";
	}
	else
	{
		cout<<"YES\n";
		cout<<ans1.first<<" "<<ans1.second<<"\n";
		cout<<ans2.first<<" "<<ans2.second<<"\n";
	}

}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define mod 1000000007

int main()
{
	vector< pair<ll,ll> > pos[200000];
	vector< pair<ll,ll> > neg[200000];
	ll k,i,j;
	cin>>k;
	pair<ll,ll> ans1,ans2;
	ll fnd=0;
	for(i=1;i<=k;i++)
	{
		ll n,m,x,y,sum=0,z;
		cin>>n;
		ll a[n]={};
		for(j=1;j<=n;j++)
		{
			cin>>a[j];
			sum+=a[j];
		}

		if(fnd==0)
		{

		map<ll,ll> mp;
		pair<ll,ll> pr;

		for(j=1;j<n && fnd==0;j++)
		{
			if(mp[a[j]]==0)
			{
				pr.first=i;
				x=sum-a[j];
				pr.second=j;
				if(x>=0)
				{
					if(pos[x].size()>0)
					{
						//cout<<"SUM:"<<x<<"\n";
						fnd=1;
						ans1=pr;
						ans2=pos[x][0];
					}
					else
					{
						pos[x].push_back(pr);
					}
				}
				else
				{
					if(neg[x].size()>0)
					{
						fnd=1;
						ans1=pr;
						ans2=neg[x][0];
					}
					else
					{
						neg[x].push_back(pr);
					}
				}
			}
			mp[a[j]]++;
		}

		}

	}

	if(fnd==0)
	{
		cout<<"NO\n";
	}
	else
	{
		cout<<"YES\n";
		cout<<ans1.first<<" "<<ans1.second<<"\n";
		cout<<ans2.first<<" "<<ans2.second<<"\n";
	}

}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define mod 1000000007

int main()
{
	map<ll, pair<ll,ll> > don;
	map<ll,ll> sup;
	ll k,i,j;
	cin>>k;
	pair<ll,ll> ans1,ans2;
	ll fnd=0;
	for(i=1;i<=k;i++)
	{
		ll n,m,x,y,sum=0,z;
		cin>>n;
		ll a[n+1]={};
		for(j=1;j<=n;j++)
		{
			cin>>a[j];
			sum+=a[j];
		}

		if(fnd==0)
		{

		map<ll,ll> mp;
		pair<ll,ll> pr,tr;

		for(j=1;j<=n && fnd==0;j++)
		{
			if(mp[a[j]]==0)
			{
				pr.first=i;
				x=sum-a[j];
				pr.second=j;
				if(sup[x]>0)
				{
					fnd=1;
					ans1=don[x];
					ans2=pr;
				}
				else
				{
					don[x]=pr;
					sup[x]++;
				}
			}
			mp[a[j]]++;
		}

		}

	}

	if(fnd==0)
	{
		cout<<"NO\n";
	}
	else
	{
		cout<<"YES\n";
		cout<<ans1.first<<" "<<ans1.second<<"\n";
		cout<<ans2.first<<" "<<ans2.second<<"\n";
	}

}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define mod 1000000007

int main()
{
	map<ll, pair<ll,ll> > don;
	map<ll,ll> sup;
	ll k,i,j;
	cin>>k;
	pair<ll,ll> ans1,ans2;
	ll fnd=0;
	for(i=1;i<=k;i++)
	{
		ll n,m,x,y,sum=0,z;
		cin>>n;
		ll a[n]={};
		for(j=1;j<=n;j++)
		{
			cin>>a[j];
			sum+=a[j];
		}

		if(fnd==0)
		{

		map<ll,ll> mp;
		pair<ll,ll> pr,tr;

		for(j=1;j<n && fnd==0;j++)
		{
			if(mp[a[j]]==0)
			{
				pr.first=i;
				x=sum-a[j];
				pr.second=j;
				if(sup[x]>0)
				{
					fnd=1;
					ans1=don[x];
					ans2=pr;
				}
				else
				{
					don[x]=pr;
					sup[x]++;
				}
			}
			mp[a[j]]++;
		}

		}

	}

	if(fnd==0)
	{
		cout<<"NO\n";
	}
	else
	{
		cout<<"YES\n";
		cout<<ans1.first<<" "<<ans1.second<<"\n";
		cout<<ans2.first<<" "<<ans2.second<<"\n";
	}

}


#include <iostream>
#include <string.h>
#include <algorithm>
#include <stdio.h>
#include <set>
using namespace std;
struct node{
	int val,pos;
	node(){val=0;pos=0;
	}
}a[2000005];
int b[2000005];
int main()
{
	int flag=-1;
	int n,k;
	cin>>k;
	for(int i=1;i<=k;i++)
	{
		cin>>n;
		int sum=0;
		for(int j=0;j<n;j++)
		{
			cin>>b[j];
			b[j];
			sum+=b[j];
		}
			sum+=1000000;
		if(flag==-1)
		for(int j=0;j<n;j++)
		{
			if(a[sum-b[j]].pos!=0&&a[sum-b[j]].pos!=i )
			{
				printf("YES\n%d %d\n%d %d\n",a[sum-b[j]].pos,a[sum-b[j]].val,i,j+1);
				flag=1;
				break;
			}
			a[sum-b[j]].pos=i;a[sum-b[j]].val=j+1;
		}
	}
	if(flag==-1) cout<<"NO"<<endl;
	return 0;
}


#include <iostream>
#include <string.h>
#include <algorithm>
#include <stdio.h>
#include <set>
using namespace std;
struct node{
	int val,pos;
	node(){val=0;pos=0;
	}
}a[200005];
int b[200005];
int main()
{
	int flag=-1;
	int n,k;
	cin>>k;
	for(int i=1;i<=k;i++)
	{
		cin>>n;
		int sum=0;
		for(int j=0;j<n;j++)
		{
			cin>>b[j];
			sum+=b[j];
		}
		if(flag==-1)
		for(int j=0;j<n;j++)
		{
			if(a[sum-b[j]].pos!=0&&a[sum-b[j]].pos!=i )
			{
				printf("YES\n%d %d\n%d %d\n",a[sum-b[j]].pos,a[sum-b[j]].val,i,j+1);
				flag=1;
				break;
			}
			a[sum-b[j]].pos=i;a[sum-b[j]].val=j+1;
		}
	}
	if(flag==-1) cout<<"NO"<<endl;
	return 0;
}


#include <iostream>
#include <string.h>
#include <algorithm>
#include <stdio.h>
#include <set>
using namespace std;
struct node{
	int val,pos;
	node(){val=0;pos=0;
	}
}a[2000005];
int b[2000005];
int main()
{
	int flag=-1;
	int n,k;
	cin>>k;
	for(int i=1;i<=k;i++)
	{
		cin>>n;
		int sum=0;
		for(int j=0;j<n;j++)
		{
			cin>>b[j];
			b[j];
			sum+=b[j];
		}
		if(flag==-1)
		for(int j=0;j<n;j++)
		{
			sum+=1000000;
			if(a[sum-b[j]].pos!=0&&a[sum-b[j]].pos!=i )
			{
				printf("YES\n%d %d\n%d %d\n",a[sum-b[j]].pos,a[sum-b[j]].val,i,j+1);
				flag=1;
				break;
			}
			a[sum-b[j]].pos=i;a[sum-b[j]].val=j+1;
		}
	}
	if(flag==-1) cout<<"NO"<<endl;
	return 0;
}


#include <iostream>
#include <string.h>
#include <algorithm>
#include <stdio.h>
#include <set>
using namespace std;
struct node{
	int val,pos;
	node(){val=0;pos=0;
	}
}a[2000005];
int b[2000005];
int main()
{
	int flag=-1;
	int n,k;
	cin>>k;
	for(int i=1;i<=k;i++)
	{
		cin>>n;
		int sum=0;
		for(int j=0;j<n;j++)
		{
			cin>>b[j];b[j]+=10000;
			sum+=b[j];
		}
		if(flag==-1)
		for(int j=0;j<n;j++)
		{
			if(a[sum-b[j]].pos!=0&&a[sum-b[j]].pos!=i )
			{
				printf("YES\n%d %d\n%d %d\n",a[sum-b[j]].pos,a[sum-b[j]].val,i,j+1);
				flag=1;
				break;
			}
			a[sum-b[j]].pos=i;a[sum-b[j]].val=j+1;
		}
	}
	if(flag==-1) cout<<"NO"<<endl;
	return 0;
}


#include <iostream>
#include <string.h>
#include <algorithm>
#include <stdio.h>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
struct node{
	ll val,pos;
	node(){val=0;pos=0;
	}
	node(ll a,ll b){
		val=a,pos=b;
	}
};
ll b[200005];
map<ll,node> q;
int main()
{
	ll flag=-1;
	ll n,k;
	cin>>k;
	for(ll i=1;i<=k;i++)
	{
		cin>>n;
		ll sum=0;
		for(ll j=0;j<n;j++)
		{
			cin>>b[j];
			b[j];
			sum+=b[j];
		}
		if(flag==-1)
		for(ll j=0;j<n;j++)
		{
			if(q.count(sum-b[j])&&q[sum-b[j]].pos!=i)
			{
				printf("YES\n%lld %lld\n%lld %lld\n",q[sum-b[j]].pos,q[sum-b[j]].val,i,j+1);
				flag=1;
				break;
			}
			q[sum-b[j]].pos=i;q[sum-b[j]].val=j+1;
		}
	}
	if(flag==-1) cout<<"NO"<<endl;
	return 0;
}


#include <iostream>
#include <string.h>
#include <algorithm>
#include <stdio.h>
#include <set>
using namespace std;
struct node{
	int val,pos;
	node(){val=0;pos=0;
	}
}a[2000005];
int b[2000005];
int main()
{
	int flag=-1;
	int n,k;
	cin>>k;
	for(int i=1;i<=k;i++)
	{
		cin>>n;
		int sum=0;
		for(int j=0;j<n;j++)
		{
			cin>>b[j];
			sum+=b[j];
		}
		if(flag==-1)
		for(int j=0;j<n;j++)
		{
			if(a[sum-b[j]].pos!=0&&a[sum-b[j]].pos!=i )
			{
				printf("YES\n%d %d\n%d %d\n",a[sum-b[j]].pos,a[sum-b[j]].val,i,j+1);
				flag=1;
				break;
			}
			a[sum-b[j]].pos=i;a[sum-b[j]].val=j+1;
		}
	}
	if(flag==-1) cout<<"NO"<<endl;
	return 0;
}


/**
   思路：
因为要找两组序列值相同的即：
euqal= remove(i,a); 删除i列中第a个元素。
||
equal=remove(j,b); 删除j序列中第b个元素。
从而想到映射的关系：
用STL中的map存储，sum作为key，（i,a）作为value
每次输入一个序列，即进行查找，若有则输出，查找完了还没找到，就将这次的压入map中，以便后面进行查找。
*/

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <map>
using namespace std;
const int maxn = 200050;
long long int a[maxn];
int main(){
    int n, m;
    map<int, pair<int, int> >mp;
    cin >> n;
    for(int j = 1; j <= n; j++){
        cin >> m;
        long long sum = 0;
        for(int i = 1; i <= m; ++i){
            scanf("%lld", &a[i]);
            sum += a[i];
        }
        for(int i = 1; i <= m; ++i){
            if(mp.count(sum - a[i])){
                printf("YES\n");
                printf("%d %d\n",mp[sum-a[i]].first, mp[sum-a[i]].second);
                printf("%d %d\n",j,i);
                return 0;
            }
        }
        for(int i = 1; i <= m; ++i){
            mp[sum-a[i]] = {j, i};
        }
    }
    printf("NO\n");
    return 0;
}


/**
   思路：
因为要找两组序列值相同的即：
euqal= remove(i,a); 删除i列中第a个元素。
||
equal=remove(j,b); 删除j序列中第b个元素。
从而想到映射的关系：
用STL中的map存储，sum作为key，（i,a）作为value
每次输入一个序列，即进行查找，若有则输出，查找完了还没找到，就将这次的压入map中，以便后面进行查找。
*/

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <map>
using namespace std;
const int maxn = 200050;
long long int a[maxn];
int main(){
    int n, m;
    map<long long , pair<long long, long long > > mp;
    cin >> n;
    for(int j = 1; j <= n; j++){
        cin >> m;
        long long sum = 0;
        for(int i = 1; i <= m; ++i){
            scanf("%lld", &a[i]);
            sum += a[i];
        }
        for(int i = 1; i <= m; ++i){
            if(mp.count(sum - a[i])){
                printf("YES\n");
                printf("%lld %lld\n",mp[sum-a[i]].first, mp[sum-a[i]].second);
                printf("%lld %lld\n",j,i);
                return 0;
            }
        }
        for(int i = 1; i <= m; ++i){
            mp[sum-a[i]] = {j, i};
        }
    }
    printf("NO\n");
    return 0;
}


/**
   思路：
因为要找两组序列值相同的即：
euqal= remove(i,a); 删除i列中第a个元素。
||
equal=remove(j,b); 删除j序列中第b个元素。
从而想到映射的关系：
用STL中的map存储，sum作为key，（i,a）作为value
每次输入一个序列，即进行查找，若有则输出，查找完了还没找到，就将这次的压入map中，以便后面进行查找。
*/

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <map>
using namespace std;
const int maxn = 200050;
long long int a[maxn];
int main(){
    int n, m;
    map<long long, pair<int, int> >mp;
    cin >> n;
    for(int j = 1; j <= n; j++){
        cin >> m;
        long long sum = 0;
        for(int i = 1; i <= m; ++i){
            scanf("%lld", &a[i]);
            sum += a[i];
        }
        for(int i = 1; i <= m; ++i){
            if(mp.count(sum - a[i])){
                printf("YES\n");
                printf("%d %d\n",mp[sum-a[i]].first, mp[sum-a[i]].second);
                printf("%d %d\n",j,i);
                return 0;
            }
        }
        for(int i = 1; i <= m; ++i){
            mp[sum-a[i]] = {j, i};
        }
    }
    printf("NO\n");
    return 0;
}


/**
   思路：
因为要找两组序列值相同的即：
euqal= remove(i,a); 删除i列中第a个元素。
||
equal=remove(j,b); 删除j序列中第b个元素。
从而想到映射的关系：
用STL中的map存储，sum作为key，（i,a）作为value
每次输入一个序列，即进行查找，若有则输出，查找完了还没找到，就将这次的压入map中，以便后面进行查找。
*/

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <map>
using namespace std;
const int maxn = 200050;
long long int a[maxn];
int main(){
    int n, m;
    map<long long, pair<long long, int> >mp;
    cin >> n;
    for(int j = 1; j <= n; j++){
        cin >> m;
        long long sum = 0;
        for(int i = 1; i <= m; ++i){
            scanf("%lld", &a[i]);
            sum += a[i];
        }
        for(int i = 1; i <= m; ++i){
            if(mp.count(sum - a[i])){
                printf("YES\n");
                printf("%d %d\n",mp[sum-a[i]].first, mp[sum-a[i]].second);
                printf("%d %d\n",j,i);
                return 0;
            }
        }
        for(int i = 1; i <= m; ++i){
            mp[sum-a[i]] = {j, i};
        }
    }
    printf("NO\n");
    return 0;
}


/**
   思路：
因为要找两组序列值相同的即：
euqal= remove(i,a); 删除i列中第a个元素。
||
equal=remove(j,b); 删除j序列中第b个元素。
从而想到映射的关系：
用STL中的map存储，sum作为key，（i,a）作为value
每次输入一个序列，即进行查找，若有则输出，查找完了还没找到，就将这次的压入map中，以便后面进行查找。
*/

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <map>
using namespace std;
const int maxn = 200050;
long long int a[maxn];
int main(){
    int n, m;
    map<long long , pair<long long, long long > > mp;
    cin >> n;
    for(int j = 1; j <= n; j++){
        cin >> m;
        long long sum = 0;
        for(int i = 1; i <= m; ++i){
            scanf("%d", &a[i]);
            sum += a[i];
        }
        for(int i = 1; i <= m; ++i){
            if(mp.count(sum - a[i])){
                printf("YES\n");
                printf("%d %d\n",mp[sum-a[i]].first, mp[sum-a[i]].second);
                printf("%d %d\n",j,i);
                return 0;
            }
        }
        for(int i = 1; i <= m; ++i){
            mp[sum-a[i]] = {j, i};
        }
    }
    printf("NO\n");
    return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <map>
using namespace std;
const int maxn = 200050;
long long int a[maxn];
int main(){
    int n, m;
    map<long long , pair<long long, long long > > mp;
    cin >> n;
    for(int j = 1; j <= n; j++){
        cin >> m;
        long long sum = 0;
        for(int i = 1; i <= m; ++i){
            scanf("%lld", &a[i]);
            sum += a[i];
        }
        for(int i = 1; i <= m; ++i){
            if(mp.count(sum - a[i])){
                printf("YES\n");
                printf("%lld %lld\n",mp[sum-a[i]].first, mp[sum-a[i]].second);
                printf("%d %d\n",j,i);
                return 0;
            }
        }
        for(int i = 1; i <= m; ++i){
            mp[sum-a[i]] = {j, i};
        }
    }
    printf("NO\n");
    return 0;
}


/**
   思路：
因为要找两组序列值相同的即：
euqal= remove(i,a); 删除i列中第a个元素。
||
equal=remove(j,b); 删除j序列中第b个元素。
从而想到映射的关系：
用STL中的map存储，sum作为key，（i,a）作为value
每次输入一个序列，即进行查找，若有则输出，查找完了还没找到，就将这次的压入map中，以便后面进行查找。
*/
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <map>
using namespace std;
const int maxn = 200050;
long long int a[maxn];
int main(){
    int n, m;
    map<long long , pair<long long, long long > > mp;
    cin >> n;
    for(int j = 1; j <= n; j++){
        cin >> m;
        long long sum = 0;
        for(int i = 1; i <= m; ++i){
            scanf("%lld", &a[i]);
            sum += a[i];
        }
        for(int i = 1; i <= m; ++i){
            if(mp.count(sum - a[i])){
                printf("YES\n");
                printf("%lld %lld\n",mp[sum-a[i]].first, mp[sum-a[i]].second);
                printf("%d %d\n",j,i);
                return 0;
            }
        }
        for(int i = 1; i <= m; ++i){
            mp[sum-a[i]] = {j, i};
        }
    }
    printf("NO\n");
    return 0;
}


/**
   思路：
因为要找两组序列值相同的即：
euqal= remove(i,a); 删除i列中第a个元素。
||
equal=remove(j,b); 删除j序列中第b个元素。
从而想到映射的关系：
用STL中的map存储，sum作为key，（i,a）作为value
每次输入一个序列，即进行查找，若有则输出，查找完了还没找到，就将这次的压入map中，以便后面进行查找。
*/

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <map>
using namespace std;
const int maxn = 200050;
long long int a[maxn];
int main(){
    int n, m;
    map<long long , pair<long long, long long > > mp;
    cin >> n;
    for(int j = 1; j <= n; j++){
        cin >> m;
        long long sum = 0;
        for(int i = 1; i <= m; ++i){
            scanf("%d", &a[i]);
            sum += a[i];
        }
        for(int i = 1; i <= m; ++i){
            if(mp.count(sum - a[i])){
                printf("YES\n");
                printf("%lld %lld\n",mp[sum-a[i]].first, mp[sum-a[i]].second);
                printf("%lld %lld\n",j,i);
                return 0;
            }
        }
        for(int i = 1; i <= m; ++i){
            mp[sum-a[i]] = {j, i};
        }
    }
    printf("NO\n");
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define si(n) scanf("%d",&n);
#define PI acos(-1.0)
#define sl(n) scanf("%lld",&n);
#define sf(n) scanf("%lf",&n);
#define ss(n) scanf("%s",n);
#define for0(i,n) for(ll i=0;i<n;i++)
#define for1(i,n) for(ll i=1;i<=n;i++)
#define forc(i,j,n) for(ll i=j;i<n;i++)
#define pb push_back
#define sor(n) sort(n.begin(),n.end())
#define sorcmp(n) sort(n.begin(),n.end(),cmp)
#define rev(n) reverse(n.begin(),n.end())
#define pi(x)  prllf("%d",x);
#define pl(x)  prllf("%lld",x);
#define pf(x)  prllf("%.10lf",x);
#define ps(x)  prllf("%s",x);
#define en() prllf("\n");
#define random_shuffle(r...)random_shuffle(r,[](int _){return rand()%_;})
#define SQR(a) (a)*(a)
#define mod 100000007
void fastio(){ios_base::sync_with_stdio(false);cin.tie(NULL);}
template <typename T> T POW(T B,T P){ if(P==0) return 1; if(P&1) return B*POW(B,P-1);  else return SQR(POW(B,P/2));}
ll powmod(ll a, ll b){ll ans = 1;while(b){if(b&1) ans = ans*a%mod;a = a*a%mod;b >>= 1;}return ans;}

bool cmp(string x,string y)
{
    if(x.size()==y.size())
    {
        if(x<y) return true;
        else return false;
    }
    if(x.size()<y.size()) return true;
    else return false;

}

int main()
{
     int t;
     cin>>t;
     vector<int>v[t];
     map<ll,ll>mp;

     for(int i=0;i<t;i++)
     {
         int n;
         cin>>n;
         ll sum=0;
         for(int j=0;j<n;j++)
         {
             int x;
             cin>>x;
             v[i].pb(x);
             sum+=x;
         }

         mp[i]=sum;
     }

      bool flag=false;
     for(int i=0;i<t;i++)
     {
         for(int j=i+1; j<t;j++)
         {  if(j==i) continue;

            for(int k=0;k<v[i].size();k++)
            {
                ll p1=mp[i]-v[i][k];
                ll p2=mp[j];
                int temp=p2- p1;
                if(temp>0){
                int pos=lower_bound(v[j].begin(),v[j].end(),temp)-v[j].begin();
                if(pos!=v[j].size() && v[j][pos]==temp )
                {
                    //cout<<v[j][pos]<<endl;
                    flag=true;
                    cout<<"YES"<<endl;
                    cout<<i+1<<" "<<k+1<<endl;
                    cout<<j+1<<" "<<pos+1<<endl;
                    return 0;

                }
                }

                p1=mp[j]-v[j][k];
                p2=mp[i];
                temp=p2-p1;
                if(temp<=0) continue;
                 int pos=lower_bound(v[i].begin(),v[i].end(),temp)-v[i].begin();
                if(pos!=v[i].size() && v[i][pos]==temp )
                {
                    //cout<<v[j][pos]<<endl;
                    flag=true;
                    cout<<"YES"<<endl;
                    cout<<i+1<<" "<<k+1<<endl;
                    cout<<j+1<<" "<<pos+1<<endl;
                    return 0;

                }

            }
            if(flag==true) break;

         }
           //cout<<i<<" "<<"Painai"<<endl;

         if(flag==true) break;
     }

     cout<<"NO"<<endl;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define si(n) scanf("%d",&n);
#define PI acos(-1.0)
#define sl(n) scanf("%lld",&n);
#define sf(n) scanf("%lf",&n);
#define ss(n) scanf("%s",n);
#define for0(i,n) for(ll i=0;i<n;i++)
#define for1(i,n) for(ll i=1;i<=n;i++)
#define forc(i,j,n) for(ll i=j;i<n;i++)
#define pb push_back
#define sor(n) sort(n.begin(),n.end())
#define sorcmp(n) sort(n.begin(),n.end(),cmp)
#define rev(n) reverse(n.begin(),n.end())
#define pi(x)  prllf("%d",x);
#define pl(x)  prllf("%lld",x);
#define pf(x)  prllf("%.10lf",x);
#define ps(x)  prllf("%s",x);
#define en() prllf("\n");
#define random_shuffle(r...)random_shuffle(r,[](int _){return rand()%_;})
#define SQR(a) (a)*(a)
#define mod 100000007
void fastio(){ios_base::sync_with_stdio(false);cin.tie(NULL);}
template <typename T> T POW(T B,T P){ if(P==0) return 1; if(P&1) return B*POW(B,P-1);  else return SQR(POW(B,P/2));}
ll powmod(ll a, ll b){ll ans = 1;while(b){if(b&1) ans = ans*a%mod;a = a*a%mod;b >>= 1;}return ans;}

bool cmp(string x,string y)
{
    if(x.size()==y.size())
    {
        if(x<y) return true;
        else return false;
    }
    if(x.size()<y.size()) return true;
    else return false;

}

int main()
{
     int t;
     cin>>t;
     vector<int>v[t];
     map<ll,ll>mp;

     for(int i=0;i<t;i++)
     {
         int n;
         cin>>n;
         ll sum=0;
         for(int j=0;j<n;j++)
         {
             int x;
             cin>>x;
             v[i].pb(x);
             sum+=x;
         }

         mp[i]=sum;
     }

      bool flag=false;
     for(int i=0;i<t-1;i++)
     {
         for(int j=i+1; j<t;j++)
         {  if(j==i) continue;

            for(int k=0;k<v[i].size();k++)
            {
                ll p1=mp[i]-v[i][k];
                ll p2=mp[j];
                int temp=p2- p1;
                if(temp>0){
                int pos=lower_bound(v[j].begin(),v[j].end(),temp)-v[j].begin();
                if(pos!=v[j].size() && v[j][pos]==temp )
                {
                    //cout<<v[j][pos]<<endl;
                    flag=true;
                    cout<<"YES"<<endl;
                    cout<<i+1<<" "<<k+1<<endl;
                    cout<<j+1<<" "<<pos+1<<endl;
                    return 0;

                }
                }

               if(k==v[j].size() ) break;
                p1=mp[j]-v[j][k];
                p2=mp[i];
                temp=p2-p1;
                if(temp<=0) continue;
                 int pos=lower_bound(v[i].begin(),v[i].end(),temp)-v[i].begin();
                if(pos!=v[i].size() && v[i][pos]==temp )
                {
                    //cout<<v[j][pos]<<endl;
                    flag=true;
                    cout<<"YES"<<endl;
                    cout<<i+1<<" "<<k+1<<endl;
                    cout<<j+1<<" "<<pos+1<<endl;
                    return 0;

                }

            }
            if(flag==true) break;

         }
           //cout<<i<<" "<<"Painai"<<endl;

         if(flag==true) break;
     }

     cout<<"NO"<<endl;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define si(n) scanf("%d",&n);
#define PI acos(-1.0)
#define sl(n) scanf("%lld",&n);
#define sf(n) scanf("%lf",&n);
#define ss(n) scanf("%s",n);
#define for0(i,n) for(ll i=0;i<n;i++)
#define for1(i,n) for(ll i=1;i<=n;i++)
#define forc(i,j,n) for(ll i=j;i<n;i++)
#define pb push_back
#define sor(n) sort(n.begin(),n.end())
#define sorcmp(n) sort(n.begin(),n.end(),cmp)
#define rev(n) reverse(n.begin(),n.end())
#define pi(x)  prllf("%d",x);
#define pl(x)  prllf("%lld",x);
#define pf(x)  prllf("%.10lf",x);
#define ps(x)  prllf("%s",x);
#define en() prllf("\n");
#define random_shuffle(r...)random_shuffle(r,[](int _){return rand()%_;})
#define SQR(a) (a)*(a)
#define mod 100000007
void fastio(){ios_base::sync_with_stdio(false);cin.tie(NULL);}
template <typename T> T POW(T B,T P){ if(P==0) return 1; if(P&1) return B*POW(B,P-1);  else return SQR(POW(B,P/2));}
ll powmod(ll a, ll b){ll ans = 1;while(b){if(b&1) ans = ans*a%mod;a = a*a%mod;b >>= 1;}return ans;}

bool cmp(string x,string y)
{
    if(x.size()==y.size())
    {
        if(x<y) return true;
        else return false;
    }
    if(x.size()<y.size()) return true;
    else return false;

}

int main()
{
     fastio();
     int t;
     cin>>t;
     vector<int>v[t],temp[t];
     map<ll,ll>mp,save;

     for(int i=0;i<t;i++)
     {
         int n;
         cin>>n;
         ll sum=0;
         for(int j=0;j<n;j++)
         {
             int x;
             cin>>x;
             v[i].pb(x);
             sum+=x;
         }

         mp[i]=sum;
         map<ll,ll>tp;
         for(int j=0;j<n;j++)
         {
             temp[i].pb(sum-v[i][j]);

             if(tp[sum-v[i][j]]) continue;
             tp[sum-v[i][j]]++;
             //cout<<sum-v[i][j]<<endl;
             save[sum-v[i][j]]++;
         }

     }

     int srch=-1;
     for(auto u:save)
     {
         if(u.second>=2)
         {
             srch=u.first;
            // cout<<srch<<endl;
             break;
         }
     }
    int in1,in2,v1,v2;
    bool flag=false;
    if(srch==-1)
    {
        return cout<<"NO"<<endl,0;
    }

     for(int i=0;i<t;i++)
     {
         for(int j=0;j<temp[i].size();j++)
         {
             if(temp[i][j]==srch)
             {
                in1=i+1;
                v1=j+1;
                flag=true;
                break;
             }
         }
         if(flag==true) break;
     }

     flag=false;
      for(int i=0;i<t;i++)
     {
         for(int j=0;j<temp[i].size();j++)
         {
             if(temp[i][j]==srch && i+1!=in1)
             {
                in2=i+1;
                v2=j+1;
                flag=true;
                break;
             }
         }
         if(flag==true) break;
     }
     cout<<"YES"<<endl;
     cout<<in1<<" "<<v1<<endl;
     cout<<in2<<" "<<v2<<endl;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define si(n) scanf("%d",&n);
#define PI acos(-1.0)
#define sl(n) scanf("%lld",&n);
#define sf(n) scanf("%lf",&n);
#define ss(n) scanf("%s",n);
#define for0(i,n) for(ll i=0;i<n;i++)
#define for1(i,n) for(ll i=1;i<=n;i++)
#define forc(i,j,n) for(ll i=j;i<n;i++)
#define pb push_back
#define sor(n) sort(n.begin(),n.end())
#define sorcmp(n) sort(n.begin(),n.end(),cmp)
#define rev(n) reverse(n.begin(),n.end())
#define pi(x)  prllf("%d",x);
#define pl(x)  prllf("%lld",x);
#define pf(x)  prllf("%.10lf",x);
#define ps(x)  prllf("%s",x);
#define en() prllf("\n");
#define random_shuffle(r...)random_shuffle(r,[](int _){return rand()%_;})
#define SQR(a) (a)*(a)
#define mod 100000007
void fastio(){ios_base::sync_with_stdio(false);cin.tie(NULL);}
template <typename T> T POW(T B,T P){ if(P==0) return 1; if(P&1) return B*POW(B,P-1);  else return SQR(POW(B,P/2));}
ll powmod(ll a, ll b){ll ans = 1;while(b){if(b&1) ans = ans*a%mod;a = a*a%mod;b >>= 1;}return ans;}

bool cmp(string x,string y)
{
    if(x.size()==y.size())
    {
        if(x<y) return true;
        else return false;
    }
    if(x.size()<y.size()) return true;
    else return false;

}

int main()
{
     int t;
     cin>>t;
     vector<int>v[t];
     map<ll,ll>mp;

     for(int i=0;i<t;i++)
     {
         int n;
         cin>>n;
         ll sum=0;
         for(int j=0;j<n;j++)
         {
             int x;
             cin>>x;
             v[i].pb(x);
             sum+=x;
         }

         mp[i]=sum;
     }

      bool flag=false;
     for(int i=0;i<t;i++)
     {
         for(int j=0; j<t;j++)
         {  if(j==i) continue;

            for(int k=0;k<v[i].size();k++)
            {
                ll p1=mp[i]-v[i][k];
                ll p2=mp[j];
                int temp=(int)p2-(int) p1;
                //cout<<"khujbo "<<temp<<endl;
                if(temp<=0) continue;
                int pos=lower_bound(v[j].begin(),v[j].end(),temp)-v[j].begin();
                if(pos!=v[j].size() && v[j][pos]==temp )
                {
                    //cout<<v[j][pos]<<endl;
                    flag=true;
                    cout<<"YES"<<endl;
                    cout<<i+1<<" "<<k+1<<endl;
                    cout<<j+1<<" "<<pos+1<<endl;
                    return 0;

                }

            }
            if(flag==true) break;

         }
           //cout<<i<<" "<<"Painai"<<endl;

         if(flag==true) break;
     }

     cout<<"NO"<<endl;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define si(n) scanf("%d",&n);
#define PI acos(-1.0)
#define sl(n) scanf("%lld",&n);
#define sf(n) scanf("%lf",&n);
#define ss(n) scanf("%s",n);
#define for0(i,n) for(ll i=0;i<n;i++)
#define for1(i,n) for(ll i=1;i<=n;i++)
#define forc(i,j,n) for(ll i=j;i<n;i++)
#define pb push_back
#define sor(n) sort(n.begin(),n.end())
#define sorcmp(n) sort(n.begin(),n.end(),cmp)
#define rev(n) reverse(n.begin(),n.end())
#define pi(x)  prllf("%d",x);
#define pl(x)  prllf("%lld",x);
#define pf(x)  prllf("%.10lf",x);
#define ps(x)  prllf("%s",x);
#define en() prllf("\n");
#define random_shuffle(r...)random_shuffle(r,[](int _){return rand()%_;})
#define SQR(a) (a)*(a)
#define mod 100000007
void fastio(){ios_base::sync_with_stdio(false);cin.tie(NULL);}
template <typename T> T POW(T B,T P){ if(P==0) return 1; if(P&1) return B*POW(B,P-1);  else return SQR(POW(B,P/2));}
ll powmod(ll a, ll b){ll ans = 1;while(b){if(b&1) ans = ans*a%mod;a = a*a%mod;b >>= 1;}return ans;}

bool cmp(string x,string y)
{
    if(x.size()==y.size())
    {
        if(x<y) return true;
        else return false;
    }
    if(x.size()<y.size()) return true;
    else return false;

}

int main()
{
     fastio();
     int t;
     cin>>t;
     vector<int>v[t];
     map<ll,ll>mp;

     for(int i=0;i<t;i++)
     {
         int n;
         cin>>n;
         ll sum=0;
         for(int j=0;j<n;j++)
         {
             int x;
             cin>>x;
             v[i].pb(x);
             sum+=x;
         }

         mp[i]=sum;
     }

      bool flag=false;
     for(int i=0;i<t-1;i++)
     {
         for(int j=i+1; j<t;j++)
         {

            for(int k=0;k<v[i].size();k++)
            {
                ll p1=mp[i]-v[i][k];
                ll p2=mp[j];
                int temp=p2- p1;
                if(temp>0){
                int pos=lower_bound(v[j].begin(),v[j].end(),temp)-v[j].begin();
                if(pos!=v[j].size() && v[j][pos]==temp )
                {
                    //cout<<v[j][pos]<<endl;
                    flag=true;
                    cout<<"YES"<<endl;
                    cout<<i+1<<" "<<k+1<<endl;
                    cout<<j+1<<" "<<pos+1<<endl;
                    return 0;

                }
                }

            }

             for(int k=0;k<v[j].size();k++)
            {
                ll p1=mp[j]-v[j][k];
                ll p2=mp[i];
                int temp=p2- p1;
                if(temp>0){
                int pos=lower_bound(v[i].begin(),v[i].end(),temp)-v[i].begin();
                if(pos!=v[i].size() && v[i][pos]==temp )
                {
                    //cout<<v[j][pos]<<endl;
                    flag=true;
                    cout<<"YES"<<endl;
                    cout<<i+1<<" "<<k+1<<endl;
                    cout<<j+1<<" "<<pos+1<<endl;
                    return 0;

                }
                }

            }

            if(flag==true) break;

         }
           //cout<<i<<" "<<"Painai"<<endl;

         if(flag==true) break;
     }

     cout<<"NO"<<endl;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define si(n) scanf("%d",&n);
#define PI acos(-1.0)
#define sl(n) scanf("%lld",&n);
#define sf(n) scanf("%lf",&n);
#define ss(n) scanf("%s",n);
#define for0(i,n) for(ll i=0;i<n;i++)
#define for1(i,n) for(ll i=1;i<=n;i++)
#define forc(i,j,n) for(ll i=j;i<n;i++)
#define pb push_back
#define sor(n) sort(n.begin(),n.end())
#define sorcmp(n) sort(n.begin(),n.end(),cmp)
#define rev(n) reverse(n.begin(),n.end())
#define pi(x)  prllf("%d",x);
#define pl(x)  prllf("%lld",x);
#define pf(x)  prllf("%.10lf",x);
#define ps(x)  prllf("%s",x);
#define en() prllf("\n");
#define random_shuffle(r...)random_shuffle(r,[](int _){return rand()%_;})
#define SQR(a) (a)*(a)
#define mod 100000007
void fastio(){ios_base::sync_with_stdio(false);cin.tie(NULL);}
template <typename T> T POW(T B,T P){ if(P==0) return 1; if(P&1) return B*POW(B,P-1);  else return SQR(POW(B,P/2));}
ll powmod(ll a, ll b){ll ans = 1;while(b){if(b&1) ans = ans*a%mod;a = a*a%mod;b >>= 1;}return ans;}

bool cmp(string x,string y)
{
    if(x.size()==y.size())
    {
        if(x<y) return true;
        else return false;
    }
    if(x.size()<y.size()) return true;
    else return false;

}

int main()
{
     int t;
     cin>>t;
     vector<int>v[t];
     map<ll,ll>mp;

     for(int i=0;i<t;i++)
     {
         int n;
         cin>>n;
         ll sum=0;
         for(int j=0;j<n;j++)
         {
             int x;
             cin>>x;
             v[i].pb(x);
             sum+=x;
         }

         mp[i]=sum;
     }

      bool flag=false;
     for(int i=0;i<t;i++)
     {
         for(int j=i+1; j<t;j++)
         {  if(j==i) continue;

            for(int k=0;k<v[i].size();k++)
            {
                ll p1=mp[i]-v[i][k];
                ll p2=mp[j];
                int temp=(int)p2-(int) p1;
                if(temp<=0) continue;
                int pos=lower_bound(v[j].begin(),v[j].end(),temp)-v[j].begin();
                if(pos!=v[j].size() && v[j][pos]==temp )
                {
                    //cout<<v[j][pos]<<endl;
                    flag=true;
                    cout<<"YES"<<endl;
                    cout<<i+1<<" "<<k+1<<endl;
                    cout<<j+1<<" "<<pos+1<<endl;
                    return 0;

                }

                p1=mp[j]-v[j][k];
                p2=mp[i];
                 temp=(int)p2-(int) p1;
                if(temp<=0) continue;
                 pos=lower_bound(v[i].begin(),v[i].end(),temp)-v[i].begin();
                if(pos!=v[i].size() && v[i][pos]==temp )
                {
                    //cout<<v[j][pos]<<endl;
                    flag=true;
                    cout<<"YES"<<endl;
                    cout<<i+1<<" "<<k+1<<endl;
                    cout<<j+1<<" "<<pos+1<<endl;
                    return 0;

                }

            }
            if(flag==true) break;

         }
           //cout<<i<<" "<<"Painai"<<endl;

         if(flag==true) break;
     }

     cout<<"NO"<<endl;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define si(n) scanf("%d",&n);
#define PI acos(-1.0)
#define sl(n) scanf("%lld",&n);
#define sf(n) scanf("%lf",&n);
#define ss(n) scanf("%s",n);
#define for0(i,n) for(ll i=0;i<n;i++)
#define for1(i,n) for(ll i=1;i<=n;i++)
#define forc(i,j,n) for(ll i=j;i<n;i++)
#define pb push_back
#define sor(n) sort(n.begin(),n.end())
#define sorcmp(n) sort(n.begin(),n.end(),cmp)
#define rev(n) reverse(n.begin(),n.end())
#define pi(x)  prllf("%d",x);
#define pl(x)  prllf("%lld",x);
#define pf(x)  prllf("%.10lf",x);
#define ps(x)  prllf("%s",x);
#define en() prllf("\n");
#define random_shuffle(r...)random_shuffle(r,[](int _){return rand()%_;})
#define SQR(a) (a)*(a)
#define mod 100000007
void fastio(){ios_base::sync_with_stdio(false);cin.tie(NULL);}
template <typename T> T POW(T B,T P){ if(P==0) return 1; if(P&1) return B*POW(B,P-1);  else return SQR(POW(B,P/2));}
ll powmod(ll a, ll b){ll ans = 1;while(b){if(b&1) ans = ans*a%mod;a = a*a%mod;b >>= 1;}return ans;}

bool cmp(string x,string y)
{
    if(x.size()==y.size())
    {
        if(x<y) return true;
        else return false;
    }
    if(x.size()<y.size()) return true;
    else return false;

}

int main()
{
     fastio();
     int t;
     cin>>t;
     vector<int>v[t],temp[t];
     map<ll,ll>mp,save;

     for(int i=0;i<t;i++)
     {
         int n;
         cin>>n;
         ll sum=0;
         for(int j=0;j<n;j++)
         {
             int x;
             cin>>x;
             v[i].pb(x);
             sum+=x;
         }

         mp[i]=sum;
         map<ll,ll>tp;
         for(int j=0;j<n;j++)
         {
             temp[i].pb(sum-v[i][j]);

             if(tp[sum-v[i][j]]) continue;
             tp[sum-v[i][j]]++;
             //cout<<sum-v[i][j]<<endl;
             save[sum-v[i][j]]++;
         }

     }

     int srch=-1;
     for(auto u:save)
     {
         if(u.second>=2)
         {
             srch=u.first;
             cout<<srch<<endl;
             break;
         }
     }
    int in1,in2,v1,v2;
    bool flag=false;
    if(srch==-1)
    {
        return cout<<"NO"<<endl,0;
    }

     for(int i=0;i<t;i++)
     {
         for(int j=0;j<temp[i].size();j++)
         {
             if(temp[i][j]==srch)
             {
                in1=i+1;
                v1=j+1;
                flag=true;
                break;
             }
         }
         if(flag==true) break;
     }

     flag=false;
      for(int i=0;i<t;i++)
     {
         for(int j=0;j<temp[i].size();j++)
         {
             if(temp[i][j]==srch && i+1!=in1)
             {
                in2=i+1;
                v2=j+1;
                flag=true;
                break;
             }
         }
         if(flag==true) break;
     }
     cout<<"YES"<<endl;
     cout<<in1<<" "<<v1<<endl;
     cout<<in2<<" "<<v2<<endl;

}


#include <bits/stdc++.h>
#define endl '\n'

using namespace std;

typedef long long int ll;
typedef long double ld;

const ll mod = 1e9 + 7;
const ld PI = 3.141592653589793;

main(){

	ios_base::sync_with_stdio(false);
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    ll k,n,a=-1,b,c,d;
    cin>>k;
    vector <ll> v[k];
    vector <multimap<int,int>> x(k);
    for (int i=0; i<k; i++) {
    	cin>>n;
    	v[i]=vector<ll>(n);
    	ll sum=0;
    	for (int j=0; j<n; j++) {cin>>v[i][j]; sum+=v[i][j];}
    	for (int j=0; j<n; j++) {v[i][j]=sum-v[i][j]; x[i].insert(make_pair(v[i][j],j+1));}
    }
    for (int i=0; i<k; i++) {
    	for (int j=i+1; j<k; j++) {
    		for (auto l=x[i].begin(); l!=x[i].end(); l++) {
    		auto jt=x[j].find(l->first);
    		if (jt!=x[j].end()) {
    		a=i+1; b=j+1; c=l->second; d=jt->second;
    		break;
    		}
    		if (a!=-1) break;
    		}
    		if (a!=-1) break;
    	}
    	if (a!=-1) break;
    }
    if (a==-1) cout<<"NO";
    else {
    	cout<<"YES\n";
    	cout<<a<<' '<<c<<endl;
    	cout<<b<<' '<<d<<endl;
    }
    return 0;
    }


#include <bits/stdc++.h>
#define endl '\n'

using namespace std;

typedef long long int ll;
typedef long double ld;

const ll mod = 1e9 + 7;
const ld PI = 3.141592653589793;

main(){

	ios_base::sync_with_stdio(false);
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    ll k,n;
    cin>>k;
    vector <ll> v(200001);
    map<ll, pair<ll,ll>> m;
    for (int i=1; i<=k; i++) {
    	cin>>n;
    	ll sum=0;
    	for (int j=1; j<=n; j++) {cin>>v[j]; sum+=v[j];}
    	for (int j=1; j<=n; j++) {
    		if (m[sum-v[j]].first) {
    			cout<<"YES\n";
    			cout<<m[sum-v[j]].first<<' '<<m[sum-v[j]].second<<endl<<i<<' '<<j<<endl;
    			return 0;
    		}
    	}
    	for (int j=1; j<=n; j++) {m[sum-v[j]]=make_pair(i,j);}
    }
    cout<<"NO";
    return 0;
    }


#include <bits/stdc++.h>
#define endl '\n'

using namespace std;

typedef long long int ll;
typedef long double ld;

const ll mod = 1e9 + 7;
const ld PI = 3.141592653589793;

main(){

	ios_base::sync_with_stdio(false);
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    ll k,n,a=-1,b,c,d;
    cin>>k;
    vector <ll> v[k];
    vector <multimap<ll,ll>> x(k);
    for (int i=0; i<k; i++) {
    	cin>>n;
    	v[i]=vector<ll>(n);
    	ll sum=0;
    	for (int j=0; j<n; j++) {cin>>v[i][j]; sum+=v[i][j];}
    	for (int j=0; j<n; j++) {v[i][j]=sum-v[i][j]; x[i].insert(make_pair(v[i][j],j+1));}
    }
    for (int i=0; i<k; i++) {
    	for (int j=i+1; j<k; j++) {
    		for (auto l=x[i].begin(); l!=x[i].end(); l++) {
    		auto jt=x[j].find(l->first);
    		if (jt!=x[j].end()) {
    		a=i+1; b=j+1; c=l->second; d=jt->second;
    		break;
    		}
    		if (a!=-1) break;
    		}
    		if (a!=-1) break;
    	}
    	if (a!=-1) break;
    }
    if (a==-1) cout<<"NO";
    else {
    	cout<<"YES\n";
    	cout<<a<<' '<<c<<endl;
    	cout<<b<<' '<<d<<endl;
    }
    return 0;
    }


#include <bits/stdc++.h>
#define endl '\n'
#define all(c) c.begin(), c.end()

using namespace std;

typedef long long int ll;
typedef long double ld;

const ll mod = 1e9 + 7;
const ld PI = 3.141592653589793;

main(){
    ios_base::sync_with_stdio(false);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    ll k;
    cin>>k;
    map<ll,pair<ll,ll>> mp;
    for (int i=0; i<k; i++) {
        ll n;
        cin>>n;
        ll sum=0;
        vector <ll> v(n);
        for (int j=0; j<n; j++) {cin>>v[j]; sum+=v[j];}
        for (int j=0; j<n; j++) {
            auto it=mp.find(sum-v[j]);
            if (it==mp.end()) mp.insert(make_pair(sum-v[j],make_pair(i,j)));
            else {
                if ((it->second).first!=i) {
                    cout<<"YES\n";
                    cout<<(it->second).first+1<<' '<<(it->second).second+1<<endl;
                    cout<<(i+1)<<' '<<(j+1)<<endl;
                    return 0;
                }
            }
        }

    }
    cout<<"NO";
    cerr<<"Time Lapsed : "<<1.0*clock()/CLOCKS_PER_SEC<<endl;
    return 0;
       }


#include <bits/stdc++.h>
#define endl '\n'

using namespace std;

typedef long long int ll;
typedef long double ld;

const ll mod = 1e9 + 7;
const ld PI = 3.141592653589793;

main(){

	ios_base::sync_with_stdio(false);
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    ll k,n,a,b,c,d;
    cin>>k;
    vector <ll> v[k];
    for (int i=0; i<k; i++) {
    	cin>>n;
    	v[i]=vector<ll>(n);
    	ll sum=0;
    	for (int j=0; j<n; j++) {cin>>v[i][j]; sum+=v[i][j];}
    	for (int j=0; j<n; j++) v[i][j]=sum-v[i][j];
    }
    for (int i=0; i<k; i++) {
    	for (int j=i+1; j<k; j++) {
    		a=-1; b=-1;
    		for (int l=0; l<v[i].size(); l++) {
    			for (int m=0; m<v[j].size(); m++) {
    				if (v[i][l]==v[j][m]) {
    					a=i+1; b=j+1; c=l+1; d=m+1;
    					break;
    				}
    					if (a!=-1 && b!=-1) break;
    			}
    			if (a!=-1 && b!=-1) break;
    		}
    		if (a!=-1 && b!=-1) break;
    	}
    		if (a!=-1 && b!=-1) break;
    }
    if (a==-1) cout<<"NO";
    else {
    	cout<<"YES\n";
    	cout<<a<<' '<<c<<endl;
    	cout<<b<<' '<<d<<endl;
    }

    return 0;
}


#include <bits/stdc++.h>
#define endl '\n'

using namespace std;

typedef long long int ll;
typedef long double ld;

const ll mod = 1e9 + 7;
const ld PI = 3.141592653589793;

main(){

	ios_base::sync_with_stdio(false);
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    ll k,n;
    cin>>k;
    vector <ll> v(200001);
    map<ll, pair<ll,ll>> m;
    for (int i=1; i<=k; i++) {
    	cin>>n;
    	ll sum=0;
    	for (int j=1; j<=n; j++) {cin>>v[j]; sum+=v[j];}
    	for (int j=1; j<=n; j++) {
    		if (m[sum-v[j]].first) {
    			cout<<m[sum-v[j]].first<<' '<<m[sum-v[j]].second<<endl<<i<<' '<<j<<endl;
    			return 0;
    		}
    	}
    	for (int j=1; j<=n; j++) {m[sum-v[j]]=make_pair(i,j);}
    }
    cout<<"NO";
    return 0;
    }


#include <bits/stdc++.h>
#define endl '\n'

using namespace std;

typedef long long int ll;
typedef long double ld;

const ll mod = 1e9 + 7;
const ld PI = 3.141592653589793;

main(){

	ios_base::sync_with_stdio(false);
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    ll k,n,a=-1,b,c,d;
    cin>>k;
    vector <ll> v[k];
    for (int i=0; i<k; i++) {
    	cin>>n;
    	v[i]=vector<ll>(n);
    	ll sum=0;
    	for (int j=0; j<n; j++) {cin>>v[i][j]; sum+=v[i][j];}
    	for (int j=0; j<n; j++) v[i][j]=sum-v[i][j];
    }
    for (int i=0; i<k; i++) {
    	map<ll,ll> m;
    	for (int j=i+1; j<k; j++) {
    		for (int l=0; l<v[j].size(); l++) {m.insert(make_pair(v[j][l], l+1));}
    		for (int l=0; l<v[i].size(); l++) {
    			auto it=m.find(v[i][l]);
    			if (it!=m.end()) {
    				a=i+1; b=j+1; c=l+1; d=it->second;
    				break;
    			}
    		}
    		if (a!=-1) break;
    	}
    	if (a!=-1) break;
    }
    if (a==-1) cout<<"NO";
    else {
    	cout<<"YES\n";
    	cout<<a<<' '<<c<<endl;
    	cout<<b<<' '<<d<<endl;
    }
    return 0;
    }


#include <bits/stdc++.h>
#define endl '\n'

using namespace std;

typedef long long int ll;
typedef long double ld;

const ll mod = 1e9 + 7;
const ld PI = 3.141592653589793;

main(){

	ios_base::sync_with_stdio(false);
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    ll k,n,a=-1,b,c,d;
    cin>>k;
    vector <ll> v[k];
    vector <multimap<int,int>> x(k);
    for (int i=0; i<k; i++) {
    	cin>>n;
    	v[i]=vector<ll>(n);
    	ll sum=0;
    	for (int j=0; j<n; j++) {cin>>v[i][j]; sum+=v[i][j];}
    	for (int j=0; j<n; j++) {v[i][j]=sum-v[i][j]; x[i].insert(make_pair(v[i][j],j+1));}
    }
    for (int i=0; i<k; i++) {
    	auto it=x[i].begin();
    	for (int j=i+1; j<k; j++) {
    		auto jt=x[j].find(it->first);
    		if (jt!=x[j].end()) {
    			a=i+1; b=j+1; c=it->second; d=jt->second;
    			break;
    		}
    		it++;
    	}
    	if (a!=-1) break;
    }
    if (a==-1) cout<<"NO";
    else {
    	cout<<"YES\n";
    	cout<<a<<' '<<c<<endl;
    	cout<<b<<' '<<d<<endl;
    }
    return 0;
    }


#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
using namespace std;
int n,m,cnt;
vector<pair<ll,pair<int,int>>> a;
int main()
{
    cin>>n;
    for (int i=0;i<n;i++){
		cin>>m;
		vector<int> x(m);
		for (int j=0;j<m;j++) cin>>x[j];
		ll s = accumulate(x.begin(),x.end(), 0);
        for (int j=0;j<m;j++){
			a.push_back(make_pair(s-x[j],make_pair(i,j)));
        }
    }
	sort(a.begin(),a.end());
    //for (int i=0;i<a.size();i++) cout<<a[i].fi<<" "<<a[i].se.fi<<" "<<a[i].se.se<<"\n";

	for (int i = 0; i < int(a.size()) - 1; ++i) {
		if (a[i].first == a[i + 1].first && (a[i].second.first != a[i + 1].second.first)) {
			cout << "YES" << endl;
			cout << a[i + 1].second.first + 1 << " " << a[i + 1].second.second + 1 << endl;
			cout << a[i].second.first + 1 << " " << a[i].second.second + 1 << endl;
			return 0;
		}
	}
	cout<<"NO";
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
using namespace std;
int n,m;
vector<pair<int,pair<int,int>>> a;
int main()
{
    cin>>n;
    for (int i=0;i<n;i++){
		cin>>m;
		vector<int> x(m);
		for (int j=0;j<m;j++) cin>>x[j];
		ll  s = accumulate(x.begin(),x.end(), 0);
        for (int j=0;j<m;j++){
			a.push_back(make_pair(s-x[j],make_pair(i,j)));
        }
    }
    //for (int i=0;i<a.size();i++) cout<<a[i].fi<<" "<<a[i].se.fi<<" "<<a[i].se.se<<"\n";
    sort(a.begin(),a.end());
	for (int i=0;i<a.size()-1;i++){
		for (int j=i+1;j<a.size();j++){
			if (a[i].fi==a[j].fi){
				if (a[i].se.fi!=a[j].se.fi){
					cout<<"YES\n";
					cout<<a[i].se.fi+1<<" ";
					cout<<a[i].se.se+1<<" "<<endl;
					cout<<a[j].se.fi+1<<" ";
					cout<<a[j].se.se+1;
					return 0;
				}
			}
		}
	}
	cout<<"NO";
    return 0;
}