#include <bits/stdc++.h>
using namespace std;
long long n, s, l, r, res, cur, maxx = -9999999999;
int main() {
  cin >> n >> s;
  for (long long i = 1; i <= n; i++) {
    cin >> l >> r;
    maxx = max(maxx, l + r);
  }
  cout << max(maxx, s);
  return 0;
}
