#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib> 
#include <ctime>
#include <unordered_map>
using namespace std;
#define x first
#define y second
#define all(v) v.begin(), v.end()
#define compress(v) (sort(all(v)), v.erase(unique(all(v)), v.end()))
typedef long long ll;
typedef pair<int, int> p;

int main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int n, x; cin >> n >> x; x *= 100;
	int sum = 0;
	for (int i = 1; i <= n; i++) {
		int a, b;
		cin >> a >> b;
		sum += a * b;
		if (sum > x) {
			cout << i; return 0;
		}
	}
	cout << -1;
}
#include <bits/stdc++.h>

#define TYPE 5

using namespace std;

typedef long long LL;

#define rep(i,n) for(LL i=0;i<(n);i++)

int main()
{
   vector<pair<int,string>> data;

   int n;

   cin >> n;

   for(int i=0; i<n; i++){
      string name;
      int h;
      cin >> name >> h;
      data.push_back(make_pair(h,name));
   }

   sort(data.begin(), data.end(), greater<pair<int,string> >());

   cout << data.at(1).second << endl;

   return 0;
}