#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, h;
  cin >> n >> h;
  vector<long long> L(n + 1), R(n + 1), D(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> L[i] >> R[i];
    D[i] = D[i - 1] + (L[i] - R[i - 1]);
  }
  long long P = 0;
  for (int i = 1; i <= n; i++) {
    int x = lower_bound(D.begin() + i + 1, D.end(), h + D[i]) - D.begin() - 1;
    P = max(P, R[x] - L[i] + h - D[x] + D[i]);
  }
  cout << P << "\n";
  return 0;
}
