#include <bits/stdc++.h>
using namespace std;
const long long MAX = 2500000000;
const int inf = 0x3f3f3f3f;
const double EPS = 1e-11;
const double PI = 2 * asin(1.0);
const long long mod = 1e9 + 7;
const long long mod2 = 1000000016531;
const long long mod3 = 1000000014367;
int double_cmp(double x, double y = 0, double tol = EPS) {
  return (x <= y + tol) ? (x + tol < y) ? -1 : 0 : 1;
}
int n, t;
pair<int, int> vetor[200];
int main() {
  scanf("%d%d", &n, &t);
  for (int i = 0; i < n; ++i) scanf("%d%d", &vetor[i].first, &vetor[i].second);
  sort(vetor, vetor + n);
  int saida = t - vetor[n - 1].first;
  for (int i = n - 1; i >= 0; --i) {
    saida = max(saida + vetor[min(n - 1, i + 1)].first - vetor[i].first,
                vetor[i].second);
  }
  saida += vetor[0].first;
  printf("%d\n", saida);
}
