#include using namespace std; using ll = long long; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b(const Dungeon &another) const{ return exp > another.exp; } }; int main(){ cin.tie(0); ios::sync_with_stdio(false); // input ll N; cin >> N; vector A; FOR(i, 0, N){ ll g, d; cin >> g >> d; ll exp = g - 30000 * d; A.push_back(Dungeon(exp, i)); } sort(ALL(A), greater()); if(A[0].exp * 6 >= 3000000){ p("YES"); }else{ p("NO"); return 0; } FOR(i, 0, 6){ p(A[0].id + 1); } return 0; }