#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  int t;
  cin >> t;
  int a[n], b[n];
  vector<int> c[n];
  for (int i = 0; i < n; ++i) cin >> a[i] >> b[i], c[i].push_back(a[i]);
  for (int i = 0; i < n; i++)
    for (int j = 1; c[i][j - 1] <= t; ++j) c[i].push_back(c[i][j - 1] + b[i]);
  int minn = 300005;
  int rec = 0;
  for (int i = 0; i < n; ++i) {
    if (find(c[i].begin(), c[i].end(), t) != c[i].end()) {
      cout << i + 1 << endl;
      return 0;
    }
    int temp = *lower_bound(c[i].begin(), c[i].end(), t);
    if (temp < minn) {
      minn = temp, rec = i;
    }
  }
  cout << rec + 1 << endl;
  return 0;
}
