#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long h;
  cin >> h;
  vector<long long> v[n];
  vector<long long> dis, len;
  for (int i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    v[i].push_back(x);
    v[i].push_back(y);
    len.push_back(y - x);
  }
  for (int i = 0; i < n - 1; i++) {
    dis.push_back(v[i + 1][0] - v[i][1]);
  }
  long long ans = len[0];
  long long hor = len[0];
  long long g = 0;
  int mi = 0;
  for (int i = 0; i < n - 1; i++) {
    g = g + dis[i];
    if (g >= h) {
      ans = max(ans, hor);
      while (g >= h) {
        g = g - dis[mi];
        hor = hor - len[mi];
        mi++;
      }
      hor = len[i + 1] + hor;
    } else {
      hor = hor + len[i + 1];
    }
  }
  ans = max(ans, hor);
  cout << ans + h;
  return 0;
}
