#include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#include<algorithm>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int solve(char num[12]){
    int q[11] = {2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6};
    int sum = 0;
    rep(i,11){
        sum += q[i] * (num[10 - i] - '0');
    }
    int mo = sum % 11;
    if(mo <= 1 && num[11] - '0' == 0){
        return 1;
    }
    if(11 - mo == num[11] - '0'){
        return 1;
    }
    return 0;
}

int main(){
    char num[12];
    int point;
    while(cin >> num){
        int ans = -1, count = 0;
        rep(i,12){
            if(num[i] == '?'){
                point = i;
                break;
            }
        }
        rep(i,10){
            num[point] = '0' + i;
            count += solve(num);
            if(count && ans == -1) ans = i;
            if(count == 2) break;
        }
        if(count != 2) cout << ans << endl;
        else cout << "MULTIPLE" << endl;
    }
}