#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
void bolt() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
long long getHeight(long long right, vector<pair<long long, long long>>& a,
                    vector<long long>& pre, long long i, long long h,
                    long long n) {
  long long l = 0, r = n - 1;
  long long idx = -1;
  while (l <= r) {
    long long mid = l + (r - l) / 2;
    if (a[mid].first >= right) {
      idx = mid;
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  if (idx == -1) idx = n;
  long long height = h - (right - a[i].first) + (pre[idx] - pre[i]);
  if (idx >= 1 and (right > a[idx - 1].first and right < a[idx - 1].second)) {
    height -= (a[idx - 1].second - right);
  }
  return height;
}
int32_t main() {
  bolt();
  long long n, h;
  cin >> n >> h;
  vector<pair<long long, long long>> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
  }
  vector<long long> pre(n + 1);
  for (long long i = 1; i <= n; i++) {
    pre[i] = pre[i - 1] + a[i - 1].second - a[i - 1].first;
  }
  long long ans = h;
  for (long long i = 0; i < n; i++) {
    long long start = a[i].first;
    long long end = INT_MAX;
    long long prob_ans = -1;
    while (start <= end) {
      long long mid = start + (end - start) / 2;
      long long height = getHeight(mid, a, pre, i, h, n);
      if (height >= 1) {
        if (height == 1) {
          prob_ans = mid - a[i].first + 1;
        }
        start = mid + 1;
      } else {
        end = mid - 1;
      }
    }
    ans = max(ans, prob_ans);
  }
  cout << ans;
  return 0;
}
