#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j = 0;
  long long n, h, x[200010], y[200010], s = 0, t = 0, ret = 0, sum = 0, ans = 0;
  cin >> n >> h;
  for (i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  x[n] = 100000000000000;
  y[n] = x[n] + 1;
  for (i = 0; i < n; i++) {
    s = x[i];
    while (h > (sum + x[j + 1] - y[j])) {
      sum += (x[j + 1] - y[j]);
      j++;
    }
    ret = h - sum;
    t = y[j] + ret;
    ans = max(t - s, ans);
    sum -= x[i + 1] - y[i];
  }
  cout << ans << endl;
}
