object Main extends App {
  val lines = scala.io.Source.stdin.getLines().toList

  // Q2
  import scala.util.Try
  lines.foreach { line =>
    val result = line.split("\\s+") match {
      case Array(a, "+", b) => Try(a.toInt + b.toInt).toOption
      case Array(a, "-", b) => Try(a.toInt - b.toInt).toOption
      case _ => None
    }
    result.foreach(println)
  }
}