import scala.math.{min,max}

object Main {
  val sc = new java.util.Scanner(System.in)
  def main(args: Array[String]) {
    val w, k = (1 to 10).map(_ => sc.nextInt).sorted.reverse.take(3).sum
    println(Seq(w, k).mkString(" ")) 
  }
}