#include <bits/stdc++.h>
using namespace std;
const int MaXI = (int)1e9;
const long long MaXN = (long long)1e18;
const int Mass = (int)1e4;
int n, m, sec, k, t, f, ans;
pair<int, int> a[Mass];
void input() {
  freopen("H.in", "r", stdin);
  freopen("H.out", "w", stdout);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  ans = m;
  for (int i = 1; i <= n; i++) {
    cin >> t >> f;
    ans = max(ans, t + f);
  }
  cout << ans;
  return 0;
}
