#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 A){ ll L = A.size(); FOR(i, 0, L){ if(i) cout << ' '; cout << A[i]; } cout << endl; } struct Dungeon{ ll exp; ll id; Dungeon(){} Dungeon(ll e, ll i){ exp = e; id = i; } bool operator<(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)); if(A[0].exp * 6 >= 3000000){ p("YES"); }else{ p("NO"); return 0; } FOR(i, 0, 6){ p(A[0].id + 1); } return 0; }