#include<bits/stdc++.h>
using namespace std;
typedef long long ll;


signed main(){
    ios::sync_with_stdio(false);
	cin.tie(0);
    cout << fixed << setprecision(20);

    string s;
    cin>>s;
    int n = s.size();
    int cnt = 0;
    int last = 0;
    int q = 0;
    bool end = true;
    reverse(s.begin(),s.end());
    for(int i=0;i<n;i++){
        if(s[i] == '?'){
            if(i!=0) end = false;
            q = i;
        }
        else{
            if(i <= 6 && i>=1){
                cnt += (s[i] - '0') * (i+1);
                cnt %= 11;
            }
            else if(i >=7 && i <= 11){
                cnt += (i-5) * (s[i] - '0');
                cnt %= 11;
            }
            else last = s[i] - '0';
        }
    }
    if(end){
        if(cnt <=1){
            cout << 0 << endl;
        }
        else cout << 11 - cnt << endl;
        return 0;
    }
    int ans = -1;
    if(last == 0){
        for(int i=0;i<10;i++){
            bool ok = false;
            if(q <= 6 && q>=1){
                if((cnt + i*(q+1))%11 <= 1) ok = 1;
            }
            else {
                if((cnt + i*(q-5))%11 <= 1) ok = 1;
            }
            if(ok){
                if(ans != -1){
                    cout << "MULTIPLE" << endl;
                    return 0;
                }
                ans = i;
            }
        }
    }
    else{
        for(int i=0;i<10;i++){
            bool ok = false;
            if(q<=6){
                if(11-(cnt + i*(q+1))%11 == last) ok = 1;
            }
            else {
                //cerr << q << endl;
                //cerr << i << " " << (cnt + i*(q-5))%11 << " " << last << endl;
                if(11-(cnt + i*(q-5))%11 == last) ok = 1;
            }
            if(ok){
                if(ans != -1){
                    cout << "MULTIPLE" << endl;
                    return 0;
                }
                ans = i;
            }
        }
    }
    cout << ans << endl;
}

