#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T, class U>
ostream& operator<<(ostream& o, const pair<T, U>& p) {
  o << "(" << p.first << "," << p.second << ")";
  return o;
}
template <class T>
ostream& operator<<(ostream& o, const vector<T>& v) {
  o << "[";
  for (T t : v) {
    o << t << ",";
  }
  o << "]";
  return o;
}
const ll INF = 1000010000;
int main() {
  int n;
  ll h;
  scanf(" %d %lld", &n, &h);
  vector<ll> l(n), r(n);
  for (int(i) = 0; (i) < (int)(n); ++(i)) scanf(" %lld %lld", &l[i], &r[i]);
  vector<ll> a, w;
  for (int(i) = 0; (i) < (int)(n - 1); ++(i)) {
    a.push_back(r[i] - l[i]);
    w.push_back(l[i + 1] - r[i]);
  }
  a.push_back(r[n - 1] - l[n - 1]);
  w.push_back(INF);
  vector<ll> sa(a), sw(w);
  for (int(i) = 0; (i) < (int)(n - 1); ++(i)) {
    sa[i + 1] += sa[i];
    sw[i + 1] += sw[i];
  }
  ll ans = 0;
  for (int(i) = 0; (i) < (int)(n); ++(i)) {
    ll W = 0;
    if (i > 0) W = sw[i - 1];
    int idx = lower_bound((sw).begin(), (sw).end(), W + h) - sw.begin();
    ll t = sa[idx];
    if (i > 0) t -= sa[i - 1];
    ans = max(ans, t);
  }
  ans += h;
  printf("%lld\n", ans);
  return 0;
}
