#include<iostream>
#include<string>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)


bool check(string s){
    int q[]={6,5,4,3,2,7,6,5,4,3,2};
    int sum=0;
    rep(i,11){
        sum+=(s[i]-'0')*q[i];
    }
    sum%=11;
    if(sum<=1)sum=0;
    else sum = 11-sum;
    if(sum == s[11]-'0')return true;
    else return false;
}

int main(){
    string s;
    int a;
    cin>>s;
    for(int i = 0; i < s.size(); i++){
        if(s[i] == '?'){
            a = i;
        }
    }
    
    int sum=0;
    int num = -1;
    
    for(int i = 0; i <= 9; i++){
        s[a] = '0'+i;
        if(check(s) == true){
            sum++;
            num = i;
        }
    }
    
    if(sum >= 2){
        cout << "MULTIPLE" << endl;
    }else{
        cout << num << endl;
    }
}