#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, h;
  cin >> n >> h;
  int s[400000], e[400000];
  for (int i = 0; i < n; i++) {
    cin >> s[i] >> e[i];
  }
  int d = 0;
  int l = e[0] - s[0] + h;
  int st = 0;
  for (int i = 1; i < n; i++) {
    d += s[i] - e[i - 1];
    while (d >= h) {
      d -= s[1 + st] - e[st];
      st++;
    }
    int cl = e[i] - s[st] + h - d;
    if (cl > l) l = cl;
  }
  cout << l << endl;
}
