#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template <typename T>
using VT = vector<T>;
template <typename T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;
const int MAX = 2e5 + 10;
int N;
LL H;
PLL seg[MAX];
LL seg_sum[MAX];
LL aida[MAX];
int main(void) {
  scanf("%d%lld", &N, &H);
  for (int(i) = 0; (i) < (N); (i)++) {
    LL x1, x2;
    scanf("%lld%lld", &x1, &x2);
    seg[i] = {x1, x2};
  }
  sort(seg, seg + N);
  for (int(i) = 0; (i) < (N - 1); (i)++) {
    aida[i + 1] = seg[i + 1].first - seg[i].second;
    aida[i + 1] += aida[i];
  }
  aida[N] = LLINF;
  for (int(i) = 0; (i) < (N); (i)++) {
    seg_sum[i + 1] = seg[i].second - seg[i].first;
    seg_sum[i + 1] += seg_sum[i];
  }
  LL ans = 0;
  for (int(i) = 0; (i) < (N); (i)++) {
    int low = i, high = N;
    while (high - low > 1) {
      const int mid = (high + low) / 2;
      if (aida[mid] - aida[i] < H) {
        low = mid;
      } else {
        high = mid;
      }
    }
    chmax(ans, H + seg_sum[high] - seg_sum[i]);
  }
  cout << ans << endl;
}
