#include <bits/stdc++.h>
using namespace std;
int getGlideValue(vector<int> &glideStartPositions,
                  unordered_map<int, int> &glide, unordered_map<int, int> &fall,
                  int x) {
  int start = 0, end = glideStartPositions.size();
  while (start < end - 1) {
    int mid = (start + end) >> 1;
    int thisFall = fall[glideStartPositions[mid]];
    if (thisFall < x)
      start = mid;
    else
      end = mid;
  }
  if (end == glideStartPositions.size()) end--;
  return glide[glideStartPositions[end]];
}
int main() {
  int n, h;
  cin >> n >> h;
  unordered_map<int, int> glide, fall;
  int doneGlide = 0;
  vector<pair<int, int> > glidePositions;
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n))) {
    int x, y;
    cin >> x >> y;
    glidePositions.emplace_back(make_pair(x, y));
  }
  sort(glidePositions.begin(), glidePositions.end());
  vector<int> glideStartPositions;
  for (auto x : glidePositions) {
    glide[x.first] = doneGlide;
    fall[x.first] = x.first - doneGlide;
    doneGlide += (x.second - x.first);
    glideStartPositions.emplace_back(x.first);
  }
  glide[(int)1e9] = doneGlide;
  fall[(int)1e9] = (int)1e9 - doneGlide;
  glideStartPositions.emplace_back((int)1e9);
  int ans = h;
  for (auto x : glideStartPositions) {
    int totalGlide =
        getGlideValue(glideStartPositions, glide, fall, h + fall[x]) - glide[x];
    ans = max(ans, totalGlide + h);
  }
  cout << ans << endl;
}
