#include <bits/stdc++.h>
using namespace std;
const long long dx[] = {-2, -1, 1, 2, -2, 1, -1, 2};
const long long dy[] = {-1, -2, 2, 1, 1, -2, 2, -1};
const long long Mod = 1e9 + 7;
const long long N = 5e5;
const long long inf = 1e9 + 1;
const long long N_N = 1e2;
long long n, m, x, y, cnt;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    cin >> x >> y;
    cnt = max(cnt, y + x);
  }
  cout << max(cnt, m);
  return 0;
}
