#include <bits/stdc++.h>
using namespace std;
long long int powermodm(long long int x, long long int n, long long int M) {
  long long int result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = (result * x) % M;
    x = (x * x) % M;
    n = n / 2;
  }
  return result;
}
long long int power(long long int _a, long long int _b) {
  long long int _r = 1;
  while (_b) {
    if (_b % 2 == 1) _r = (_r * _a);
    _b /= 2;
    _a = (_a * _a);
  }
  return _r;
}
long long int gcd(long long int a, long long int b) {
  while (a && b) a > b ? a %= b : b %= a;
  return a + b;
}
long long int lcm(long long int a, long long int b) {
  return (max(a, b) / gcd(a, b)) * min(a, b);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int n, h;
  cin >> n >> h;
  long long int x1[n + 1], x2[n + 1], i, j;
  for (i = 0; i < n; i++) cin >> x1[i] >> x2[i];
  x1[n] = 1000000000;
  x2[n] = 1000000001;
  long long int dist[n + 2];
  memset(dist, 0, sizeof(dist));
  for (i = 1; i <= n; i++) {
    dist[i] = dist[i - 1] + x1[i] - x2[i - 1];
  }
  long long int ans = 0;
  for (i = 0; i < n; i++) {
    long long int l = i + 1, r = n, mi = n;
    ans = max(ans, x2[i] - x1[i]);
    while (l <= r) {
      long long int mid = (l + r) >> 1;
      if (dist[mid] - dist[i] >= h) {
        mi = min(mi, mid);
        r = mid - 1;
      } else
        l = mid + 1;
    }
    long long int tmp = x2[mi - 1] - x1[i] + (h - (dist[mi - 1] - dist[i]));
    ans = max(ans, tmp);
  }
  cout << ans;
  return 0;
}
