#include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
const int MXX = 105;
const int MOD = 1e9 + 7;
const long long int INF = 2000000000000000000LL;
int a[MXX], b[MXX], c[MXX];
bool vis[MXX];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  int mnn;
  for (int i = 0; i < n; i++) cin >> a[i] >> b[i], c[i] = a[i];
  sort(c, c + n);
  int mn = 1e8;
  int ans = 1e9, res;
  for (int i = 0; i < n; i++) {
    long long int k = a[i];
    while (k < m) {
      k += b[i];
    }
    if (ans > k - m) {
      ans = k - m;
      res = i + 1;
    }
  }
  cout << res << endl;
  return 0;
}
