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

int main()
{
	int n, g, d, i;
	size_t max_dungeon;
	cin >> n;
	vector<int> exp;
	for (i = 0; i < n; ++i) {
		cin >> g >> d;
		exp.push_back(g - 30000 * d);
	}
	if (*max_element(exp.begin(), exp.end()) < 30000 * 100 / 6) {
		cout << "NO" << endl;
	}
	else {
		cout << "YES" << endl;
		max_dungeon = distance(exp.begin(), max_element(exp.begin(), exp.end())) + 1;
		for (i = 0; i < 6; ++i)cout << max_dungeon << endl;
	}
	return 0;
}