object Main extends App {
  import scala.io.StdIn._

  val suspects = readLine.trim
  val index = suspects.indexWhere(_ == '?')
  val correct = ('0' to '9').filter(c ⇒ isValid(suspects.updated(index, c)))
  println(if (correct.length > 1) "MULTIPLE" else correct.head)
  def isValid(suspects: String): Boolean = {
    val q = (1 to 11).map(n ⇒ if (1 <= n && n <= 6) n + 1 else n - 5)
    val checkDigit = suspects.last.asDigit
    checkDigit == (q.zip(suspects.reverse.tail).map(it ⇒ it._1 * it._2.asDigit).sum % 11).let(i ⇒ if (i <= 1) 0 else 11 - i)
  }
  implicit class Scope[T](val value: T) extends AnyVal {
    @inline def also(@inline func: T ⇒ Unit): T = {
      func(value)
      value
    }
    @inline def let[A](@inline func: T ⇒ A): A = func(value)
  }
}
