import scala.io.StdIn

object Main extends App {
  StdIn.readLine match {
    case S(a, b, c) => println(s"$a $b $c")
    case _ => throw new Exception("Invalid input.")
  }
}

object S {
  def unapply(s: String): Option[(String, String, String)] = {
    s.split(",") match {
      case Array(a, b, c) => Some(a, b, c)
      case _ => None
    }
  }
}
