#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long int
#define ff(i,n) for(i=0;i<n;i++)
//ncr(n,r) = ncr(n-1,r-1) + ncr(n-1,r)
const ll bg = 1e9+7;
void solve(){
	ll i,n,x;
	cin>>n>>x;
	x = x*100;
	ll ans = -1,sum=0;
	ll v[n],p[n];
	ff(i,n){
		cin>>v[i]>>p[i];
	}	
	ff(i,n){
		sum += v[i]*p[i];
		if(sum>x)
		{
			ans = i+1;
			break;
		}
	}
	cout<<ans;
}
int main(){
	ll t;
	t=1;
	while(t--){
		solve();
	}
}
#include <bits/stdc++.h>
 
using namespace std;

#define PB push_back
#define MP make_pair
#define LL long long
#define int LL
#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define RE(i,n) FOR(i,1,n)
#define REP(i,n) FOR(i,0,(int)(n)-1)
#define R(i,n) REP(i,n)
#define VI vector<int>
#define VVI vector<vector<int>>
#define PII pair<int,int>
#define VPII vector<PII>
#define LD long double
#define INF 1000000000000
#define MOD 1000000007
//#define MAXR 100000 // array max range
#define MAXR 200000+10
#define FI first
#define SE second
#define PQG priority_queue<int,VI,greater<int>>
#define PQL priority_queue<int,VI,less<int>>
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout << fixed << setprecision(11);
    cerr << fixed << setprecision(6);
    int n;
    int p[MAXR],mem[MAXR];
    int m=0,mm=0;
    R(i,MAXR) mem[i] = false;
    cin >> n;
    R(i,n){
        cin >> p[i];
        mem[p[i]] = true;
        if(mm==p[i]){
            FOR(j,mm+1,MAXR){
                if(!mem[j]){
                    mm=j;
                    m=j;
                    break;
                }
            }
        }
        cout << m << endl;
    }
    //int cnt=0;
    //R(i,MAXR){
    //    if(ans[i]){
    //        cout << i-1 << endl;
    //        cnt++;
    //    }
    //    if(n==cnt){
    //        break;
    //    }
    //}
    return 0;
}
