open Printf
open Scanf

let flip f x y = f y x
                   
let () =
  let n = scanf "%d " (fun x -> x) in
  let rec read x ls =
    if x = 0 then ls
    else let p = scanf "%d %d " (fun a b -> (a, b)) in
         read (x - 1) (p :: ls) in
  let ps = read n [] in
  List.sort (flip compare) ps |> List.hd |> (fun (a, b) -> printf "%d\n" (a + b))
