#include <bits/stdc++.h>
using namespace std;
int t, n, mint = 99999999, minn, ans;
struct bus {
  int s, d;
};
bus x;
int bl[10001];
int main() {
  scanf("%d%d", &n, &t);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &x.s, &x.d);
    if (x.s < t) {
      ans = t - x.s;
      ans = ans % x.d;
      if (ans == 0) {
        printf("%d", i);
        return 0;
      } else {
        ans = x.d - ans;
        if (ans < mint) {
          mint = ans;
          minn = i;
        }
      }
    } else {
      if (t == x.s) {
        cout << i;
        return 0;
      } else {
        ans = x.s - t;
        if (ans == 0) {
          cout << i;
          return 0;
        }
        if (ans < mint) {
          mint = ans;
          minn = i;
        }
      }
    }
  }
  cout << minn;
  return 0;
}
