#include using namespace std; int main() { int n; cin >> n; int m = 0, mi = 0; for (int i = 0; i < n; i++) { int g, d; cin >> g >> d; if (m < g - 30000 * d) { m = g - 30000 * d; mi = i; } } if (m < 500000) { cout << "NO" << endl; } else { cout << "YES" << endl; for (int i = 0; i < 6; i++) { cout << mi << endl; } } }