#include int main() { int level = 5000 * 100; int n; std::cin >> n; int result = 0; for (auto i = 1; i <= n; ++i) { int g, d; std::cin >> g >> d; if (level > 500000 - g + 30000 * d) { level = 500000 - g + 30000 * d; if (level <= 0) { result = i; break; } } } if (result > 0) { std::cout << "YES\n"; for (auto i = 0; i < 6; ++i) { std::cout << result << '\n'; } } else { std::cout << "NO\n"; } return 0; }