#include <bits/stdc++.h>
using namespace std;
void split(const string &s, vector<string> &tokens, char delimiter) {
  string token;
  istringstream tokenStream(s);
  while (getline(tokenStream, token, delimiter)) tokens.push_back(token);
}
int bs(int l, vector<long long> &diff, long long dec, long long h) {
  int mid, r = diff.size() - 1;
  while (l < r) {
    mid = (l + r) / 2;
    if (diff[mid] - dec == h)
      return mid;
    else if (diff[mid] - dec > h)
      r = mid;
    else
      l = mid + 1;
  }
  return (l + r) / 2;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, h;
  cin >> n >> h;
  vector<pair<int, int> > seg(n);
  vector<long long> cs(n + 1, 0), diff(n + 1, 0);
  diff[n] = 1000000007;
  for (register int i = (0); i < (n); i += (1)) {
    cin >> seg[i].first >> seg[i].second;
    cs[i + 1] = cs[i] + seg[i].second - seg[i].first;
    if (i) diff[i] = diff[i - 1] + seg[i].first - seg[i - 1].second;
  }
  long long ans = 0;
  for (register int i = (0); i < (n); i += (1)) {
    int g = bs(i + 1, diff, diff[i], h);
    if (cs[g] - cs[i] + h > ans) ans = cs[g] - cs[i] + h;
  }
  cout << ans;
  return 0;
}
