#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  int n, m, flag, s, t, minx = 0x3f3f3f3f;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> s >> t;
    while (m > s) {
      s += t;
    }
    int num = s - m;
    if (minx > num) {
      minx = num;
      flag = i;
    }
  }
  cout << flag << endl;
  return 0;
}
