#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, h;
  cin >> n >> h;
  pair<long long, long long> p[n];
  for (long long i = 0; i < n; i++) {
    cin >> p[i].first >> p[i].second;
  }
  sort(p, p + n);
  long long s[n], g[n];
  for (long long i = 0; i < n; i++) {
    s[i] = p[i].second - p[i].first;
  }
  for (long long i = 0; i < n; i++) {
    if (i == n - 1) {
      g[i] = 1000000005;
      continue;
    }
    g[i] = p[i + 1].first - p[i].second;
  }
  long long i = 0, j = 0;
  long long ans = 0;
  long long curs = s[0], curg = 0;
  while (i < n && j < n) {
    if (curg + g[j] < h) {
      if (j + 1 >= n) {
        break;
      }
      curs += s[j + 1];
      curg += g[j];
      j++;
    } else {
      ans = max(ans, curs);
      curs -= s[i];
      curg -= g[i];
      i++;
    }
    ans = max(ans, curs);
  }
  ans += h;
  cout << ans;
  return 0;
}
