#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
const int mod = 1e9 + 7;
const int nax = 2e5 + 6;
const long long inf = 2e18;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, h;
  cin >> n >> h;
  vector<long long> dists;
  vector<pair<long long, long long>> bl;
  dists.push_back(0LL);
  for (int i = 1; i <= n; i++) {
    long long x, y;
    cin >> x >> y;
    if (i > 1) {
      dists.push_back(dists.back() + abs(x - bl.back().second));
    }
    bl.push_back({x, y});
  }
  dists.push_back(inf);
  long long so_far = 0;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    long long targ = h + dists[i] - 1;
    int pos = lower_bound(dists.begin(), dists.end(), targ) - dists.begin();
    if (dists[pos] > targ) {
      pos--;
    }
    long long rem = h - (dists[pos] - dists[i]);
    ans = max(ans, bl[pos].second - bl[i].first + rem);
  }
  cout << ans << '\n';
  return 0;
}
