#include <bits/stdc++.h>
using namespace std;
vector<long long int> c;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t, n, m, q, i, j, k, x, y, z, h, ans = 0;
  cin >> n >> h;
  long long int a[n + 2], b[n + 2];
  c.assign(n + 2, 0);
  x = 0;
  for (i = 1; i < n + 1; i++) {
    cin >> a[i] >> b[i];
    c[i] = a[i] - x + c[i - 1];
    x = b[i];
  }
  c[n + 1] = 3 * (long long)1000000007;
  for (i = 1; i <= n; i++) {
    x = c[i];
    x += h;
    y = upper_bound(c.begin(), c.end(), x) - c.begin() - 1;
    if (x == c[y])
      z = a[y] - a[i];
    else
      z = b[y] - a[i] + (x - c[y]);
    ans = max(z, ans);
  }
  cout << ans << "\n";
}
