#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, h;
  int t1, t2;
  cin >> n >> h;
  vector<pair<int, int>> inter(n);
  vector<int> diffs(n);
  for (int i = 0; i < n; i++) {
    cin >> t1 >> t2;
    inter[i] = pair<int, int>(t1, t2);
    if (i > 0)
      diffs[i] = inter[i].first - inter[i - 1].second;
    else
      diffs[i] = h;
  }
  int end_ind = 0;
  int end = inter[0].second;
  int maxdist = 0;
  for (int i = 0; i < n; i++) {
    int d = diffs[i];
    while (end_ind + 1 < n && (end + d > inter[end_ind + 1].first)) {
      d = max(d - (diffs[end_ind + 1] - (end - inter[end_ind].second)), 0);
      end = inter[end_ind + 1].second;
      end_ind++;
    }
    end += d;
    d = 0;
    maxdist = max(end - inter[i].first, maxdist);
  }
  cout << maxdist << endl;
}
