
object Main {
  def main(args: Array[String]): Unit = {
    val in = new java.util.Scanner(System.in)
    val list = getList(in,10)
    val sorted = list.sorted
    val ls = sorted.reverse
    printList(ls, 3)
  }
  def getList(in:java.util.Scanner,size:Int):List[Int] ={
    if(size == 0){
      return Nil
    }
    val height = in.nextInt()
    return height :: getList(in,size-1)
  }
  def printList(list:List[Int],size : Int):Unit ={
    if(size == 0){return}
    list match{
      case l :: ls => println(l) ; printList(ls, size-1)
      case Nil => println("error")
    }
  }
}