#include <bits/stdc++.h>
using namespace std;
void init() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
int main() {
  init();
  int N, H, i, j, M, l, r, pos, best, dist, last = 0;
  cin >> N >> H;
  vector<int> x, d, p;
  for (i = 0; i < N; i++) {
    cin >> l >> r;
    x.push_back(l);
    d.push_back(l - last);
    x.push_back(r);
    d.push_back(0);
    last = r;
  }
  x.push_back(2 * 1000000000 + 1);
  d.push_back(2 * 1000000000 + 1 - last);
  p = d;
  M = p.size();
  for (i = 1; i < M; i++) p[i] += p[i - 1];
  best = H;
  for (i = 0; i < M - 1; i++) {
    pos = (int)(upper_bound(p.begin(), p.end(), H + p[i] - 1) - p.begin());
    dist = x[pos] - x[i] - (p[pos] - p[i] - H);
    best = max(best, dist);
  }
  cout << best;
  return 0;
}
