n = int(input())
a = int(input())

for i in range(1, n+1):
    b = int(input())
    c = int(input())
    
if a > b+c:
    zong_time = a
    print(zong_time)

elif a == b+c:
    zong_time = a
    print(zong_time)

elif a < b+c:
    zong_time = b+c
    print(zong_time)
    


    
    
