n,s = map(int, raw_input().split())
ans = s
for i in range(n):
f,t = map(int, raw_input().split())
ans = max(ans, t+f)
print ans
bixzID0gbWFwKGludCwgcmF3X2lucHV0KCkuc3BsaXQoKSkKYW5zID0gcwpmb3IgaSBpbiByYW5nZShuKToKCWYsdCA9IG1hcChpbnQsIHJhd19pbnB1dCgpLnNwbGl0KCkpCglhbnMgPSBtYXgoYW5zLCB0K2YpCnByaW50IGFucwo=