#include<bits/stdc++.h>
using namespace std;
int main()
{double n,x,p=0;
 
 cin>>n>>x;
  for(int i=0;i<n;i++)
  {
    double a,b;
    cin>>a>>b;
    p=p+(a*b);
    if(p>x*100)
    {cout<<i+1;
     break;
    }
    
    
  }
 
  if(x*100>=p)
    cout<<"-1";
  return 0;
}
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef struct x
{
    string a;
    long long b;
}x;
long long n;
bool cmp(x tmp1,x tmp2)
{
    return tmp1.b>tmp2.b;
}
void solve()
{
    vector < x > a(n);
    long long i;
    for (i=0;i<n;i++)
        cin>>a[i].a>>a[i].b;
    sort(a.begin(),a.end(),cmp);
    cout<<a[1].a<<endl;
}
int main()
{
    while(cin>>n)
        solve();
}