#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void in(T &x) {
  x = 0;
  int fl = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') fl = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  x *= fl;
}
template <typename T>
void out(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x / 10) out(x / 10);
  putchar(x % 10 + '0');
}
template <typename T>
inline void outln(T x) {
  out(x);
  putchar(10);
}
template <typename T>
inline void outsp(T x) {
  out(x);
  putchar(' ');
}
template <typename T>
inline T gcd(T a, T b) {
  T t;
  if (a > b) {
    while (b) {
      t = b;
      b = a % b;
      a = t;
    }
    return a;
  } else {
    while (a) {
      t = a;
      a = b % a;
      b = t;
    }
    return b;
  }
}
template <typename T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
const int N = 200005;
int n, h, l[N], r[N], ans, nowr = 2;
void move(int &R, int H) {
  if (R < l[nowr]) {
    int t = min(l[nowr] - R, H);
    R += t;
    H -= t;
  }
  while (H) {
    R = r[nowr];
    int t = min(l[nowr + 1] - R, H);
    ;
    R += t;
    H -= t;
    nowr++;
  }
}
int main() {
  in(n);
  in(h);
  for (int i = (1); i <= (n); i++) in(l[i]), in(r[i]);
  l[n + 1] = r[n + 1] = 2e9 + 5;
  int L = l[1], R = r[1];
  move(R, h);
  ans = max(ans, R - L);
  for (int i = (2); i <= (n); i++) {
    L = l[i];
    move(R, l[i] - r[i - 1]);
    ans = max(ans, R - L);
  }
  outln(ans);
  return 0;
}
