#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
    string s;
    cin >> s;
    reverse(s.begin(), s.end());
    vector<int> ans;
    for(int d=0; d<=9; d++){
        int h = 0;
        for(int i=1; i<=11; i++){
            int digit = (s[i]=='?')? d: s[i]-'0';
            if(i <= 6){
                h += digit *(i+1);
            }else{
                h += digit *(i-5);
            }
        }
        int cd = 11 - h%11;
        if(cd > 9) cd = 0;
        int digit = (s[0]=='?')? d: s[0]-'0';
        if(digit == cd){
            ans.push_back(d);
        }
    }
    if((int)ans.size() > 1){
        cout << "MULTIPLE" << endl;
    }else{
        cout << ans[0] << endl;
    }
    return 0;
}
