#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, m, s, d;
int main() {
  cin >> n >> m;
  int mix = 1e9, res = -1;
  for (int i = 0; i < n; i++) {
    cin >> s >> d;
    int temp;
    if (s >= m) {
      temp = s - m;
    } else {
      int x = (m - s + d - 1) / d;
      temp = x * d - (m - s);
    }
    if (temp < mix) {
      res = i + 1;
      mix = temp;
    }
  }
  cout << res << endl;
  return 0;
}
