object Main extends App { val (a, b, c) = scala.io.StdIn.readf3("{0} {1} {2}") val tp = (a.asInstanceOf[String], b.asInstanceOf[String], c.asInstanceOf[String]) tp match { case ("?", a, b) => println(if (a > b) 1 else 4) case (a, b, "?") => println(if (a < b) 1 else 4) case _ => println(14) } }