#include using namespace std; int main() { int N, G, D, i = 0, j = 6; cin >> N; while (cin >> G >> D && ++i) { if (G - D * 3e4 >= 5e5) { cout << "YES" << "\n"; while (j--) cout << i << "\n"; return 0; } } cout << "NO" << "\n"; }