#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long INF = 1e18;
const long long lim = 1e5;
long long n, h, d, sum[1000005], ans;
pair<long long, long long> p[1000005];
int main() {
  scanf("%lld %lld", &n, &h);
  for (int i = 1; i <= n; i++) {
    scanf("%lld %lld", &p[i].first, &p[i].second);
  }
  if (n == 1) {
    printf("%lld\n", p[1].second - p[1].first + h);
    return 0;
  }
  for (int i = 2; i <= n; i++) {
    sum[i] = sum[i - 1] + (p[i].first - p[i - 1].second);
  }
  for (int i = 2; i <= n; i++) {
    long long x = sum[i] - (h - 1);
    int j = lower_bound(sum + 1, sum + 1 + i, x) - sum;
    long long tem = h - (sum[i] - sum[j]) + (p[i].second - p[j].first);
    ans = max(ans, tem);
  }
  printf("%lld\n", ans);
}
