#include <bits/stdc++.h>
using namespace std;
int n, h, x[200020], y[200020];
long long ck[200020], sum[200020];
long long ans;
set<long long> s;
map<long long, long long> k;
int main() {
  scanf("%d%d", &n, &h);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &x[i], &y[i]);
    sum[i] = (long long)y[i] - (long long)x[i];
  }
  for (int i = 1; i <= n; i++) sum[i] += sum[i - 1];
  ck[1] = 0;
  k[0] = 1;
  s.insert(0);
  for (int i = 2; i <= n; i++) {
    ck[i] = x[i] - y[i - 1];
    ck[i] += ck[i - 1];
    k[ck[i]] = i;
    s.insert(ck[i]);
  }
  for (int i = 1; i <= n; i++) {
    auto it = s.lower_bound(ck[i] + (long long)h);
    it--;
    long long g = sum[k[*it]] - sum[i - 1];
    g += (long long)h;
    ans = max(ans, g);
  }
  cout << ans;
  return 0;
}
