#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t, k, l, j, p[200001];
  cin.tie(0);
  cin.sync_with_stdio(0);
  cout.tie(0);
  cin >> n >> t;
  for (int i = 1; i <= 200000; i++) p[i] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> k >> l;
    j = 0;
    while (k + j * l < 200001) {
      p[k + j * l] = i;
      j++;
    }
  }
  for (int i = t; i <= 200000; i++)
    if (p[i] > 0) {
      cout << p[i];
      return 0;
    }
  return 0;
}
