import scala.io.StdIn object Problem201 { def proc(a: Array[String], b: Array[String]): String = { val (nameA, pointA) = (a(0), a(1)) val (nameB, pointB) = (b(0), b(1)) pointA.length == pointB.length match { case true => pointA.compareTo(pointB) match { case 0 => "-1" case x if x > 0 => nameA case x if x < 0 => nameB } case false => if (pointA.length > pointB.length) nameA else nameB } } def main(args: Array[String]): Unit = { val a = StdIn.readLine().split(" ") val b = StdIn.readLine().split(" ") val result: String = proc(a, b) println(result) } }