#include <bits/stdc++.h>
using namespace std;
long long n, m;
pair<long long, long long> a[200100];
long long sum[200100];
long long sum1[200100];
long long dist[200100];
int main() {
  scanf("%lld %lld", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%lld %lld", &a[i].first, &a[i].second);
  for (int i = 1; i < n; i++) dist[i] = a[i + 1].first - a[i].second;
  for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + dist[i];
  long long dap = 0;
  sum[n] = 1e18;
  for (int i = 1; i <= n; i++) {
    int t = upper_bound(sum, sum + n + 1, m + sum[i - 1]) - sum;
    long long ch = m - (sum[t - 1] - sum[i - 1]);
    if (ch == 0) t--;
    long long x = a[t].second + m - (sum[t - 1] - sum[i - 1]);
    dap = max(x - a[i].first, dap);
  }
  printf("%lld", dap);
}
