fun main(args : Array<String>) {
    val input = readLine()!!.split(" ").map(String::toInt)
    val nums = input.filter { it in 1..9 }

    if (nums.size == 2) {
        println(input.reduce(Int::times))
    } else {
        println(-1)
    }
}
