#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, h;
  cin >> n >> h;
  vector<pair<long long, long long> > a(n);
  int i;
  for (i = 0; i < n; i++) {
    cin >> a[i].first;
    cin >> a[i].second;
  }
  int start = i;
  i = 0;
  long long maxm = LLONG_MIN;
  long long j = 0;
  long long val = 0;
  long long d = h;
  long long prev = 0;
  while (i < n) {
    while (j < n) {
      if (j != 0 && d - (a[j].first - prev) <= 0) {
        break;
      }
      val += a[j].second - a[j].first;
      if (j != 0) d -= (a[j].first - prev);
      prev = a[j].second;
      j++;
    }
    maxm = max(maxm, val + d + (h - d));
    val -= (a[i].second - a[i].first);
    if (j > i) {
      d += (a[i + 1].first - a[i].second);
    }
    i++;
  }
  cout << maxm << endl;
  return 0;
}
