#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
template <class T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
const int MOD = 1000000007;
const char nl = '\n';
const int MX = 100001;
int LongestIncreasingSubsequenceLength(std::vector<int>& v) {
  if (v.size() == 0) return 0;
  std::vector<int> tail(v.size(), 0);
  int length = 1;
  tail[0] = v[0];
  for (int i = 1; i < v.size(); i++) {
    auto b = tail.begin(), e = tail.begin() + length;
    auto it = lower_bound(b, e, v[i]);
    if (it == tail.begin() + length)
      tail[length++] = v[i];
    else
      *it = v[i];
  }
  return length;
}
void solve() {
  int n, t;
  cin >> n >> t;
  vector<int> second(n);
  vector<int> d(n);
  for (int i = 0; i < n; i++) {
    cin >> second[i] >> d[i];
  }
  int ans = INT_MAX;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    a[i] = second[i];
  }
  for (int i = 0; i < n; i++) {
    while (a[i] < t) {
      a[i] += d[i];
    }
    if (a[i] == t) {
      cout << i + 1 << nl;
      return;
    } else {
      ans = min(ans, a[i]);
    }
  }
  for (int i = 0; i < n; i++) {
    if (a[i] == ans) {
      cout << i + 1 << nl;
      return;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  srand(chrono::high_resolution_clock::now().time_since_epoch().count());
  int T = 1;
  while (T--) {
    solve();
  }
}
