#include <bits/stdc++.h>
using namespace std;
double PI = acos(-1);
int const N = 5e5 + 10, M = 86400, oo = 1e9;
const int mod = oo + 7;
const long long OO = 3e18;
int n, h;
int cumy[N], cumx[N];
pair<int, int> aa[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> h;
  for (int i = 1; i <= n; i++) {
    cin >> aa[i].first >> aa[i].second;
    cumx[i] = cumx[i - 1] + aa[i].second - aa[i].first;
  }
  int mx = 0;
  for (int i = 2; i <= n; i++)
    cumy[i] = cumy[i - 1] + aa[i].first - aa[i - 1].second;
  for (int i = 1; i <= n; i++) {
    int an = aa[i].second - aa[i].first, rem = h;
    int y = lower_bound(cumy, cumy + n + 1, rem + cumy[i]) - cumy;
    y--;
    an += cumx[y] - cumx[i];
    an += cumy[y] - cumy[i];
    rem -= cumy[y] - cumy[i];
    an += rem;
    mx = max(mx, an);
  }
  cout << mx << '\n';
  return 0;
}
