object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val (a, b) = List
    .fill(sc.nextInt())(sc.nextInt() -> sc.nextInt())
    .maxBy(_._1)(Ordering[Int].reverse)
  println(a + b)
}
