#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
vector<pair<long long, long long> > v;
vector<long long> x;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, h;
  cin >> n >> h;
  for (int i = 0; i < n; i++) {
    long long a, b;
    cin >> a >> b;
    v.push_back(make_pair(a, b));
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size() - 1; i++) {
    x.push_back(v[i].second - v[i].first);
    x.push_back(v[i + 1].first - v[i].second);
  }
  x.push_back(v[v.size() - 1].second - v[v.size() - 1].first);
  int i = 0, j = 0;
  long long ans = 0;
  long long temp = 0;
  while (j < x.size()) {
    if (j % 2 == 0) {
      temp += x[j];
      j++;
    } else {
      if (h - x[j] <= 0) {
        ans = max(ans, temp + h);
      }
      h -= x[j];
      temp += x[j];
      while (h <= 0) {
        if (i % 2 == 0) {
          temp -= x[i];
          i++;
        } else {
          h += x[i];
          temp -= x[i];
          i++;
        }
      }
      j++;
    }
  }
  if (h > 0) ans = max(ans, temp + h);
  cout << ans;
  return 0;
}
