#include <bits/stdc++.h>
using namespace std;
int INF = 0x3f3f3f3f;
long long mod = 1e9 + 7;
const int N = 200005;
int a[N], b[N];
int pre[N], d[N];
int main() {
  int n, h;
  scanf("%d %d", &n, &h);
  for (int i = 1; i <= n; i++) {
    scanf("%d %d", &a[i], &b[i]);
    d[i] = d[i - 1] + b[i] - a[i];
  }
  for (int i = 2; i <= n; i++) {
    pre[i] = pre[i - 1] + a[i] - b[i - 1];
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int t = lower_bound(pre + i, pre + n + 1, h + pre[i]) - pre - 1;
    int tmp = h + d[t] - d[i - 1];
    ans = max(ans, tmp);
  }
  printf("%d\n", ans);
  return 0;
}
