#include <bits/stdc++.h>
using namespace std;
struct brk {
  int start;
  int end;
};
int main() {
  int n, h;
  cin >> n >> h;
  vector<brk> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i].start >> v[i].end;
  }
  int maxi = -1;
  int curx = 0, cury = 0;
  int st = 0, nd = 0;
  while (nd < n) {
    if (st == nd) {
      curx = v[st].end - v[st].start;
      cury = 0;
      nd++;
    } else {
      if (cury + v[nd].start - v[nd - 1].end < h) {
        cury += v[nd].start - v[nd - 1].end;
        curx += v[nd].end - v[nd].start;
        nd++;
      } else {
        cury -= v[st + 1].start - v[st].end;
        curx -= v[st].end - v[st].start;
        st++;
      }
    }
    maxi = max(curx, maxi);
  }
  cout << maxi + h << endl;
  return 0;
}
