#include<iostream>
#include<string>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define hatena -1
using namespace std;

int qu(int n){
	if(1<=n && n<=6)return n+1;
	else return n-5;
}

int main(){
	char s;
	int data[12];
	for(int i=11;i>=0;i--){
		cin>>s;
		if(s=='?')data[i]=hatena;
		else data[i]=(int)(s-'0');
	}
	int tail=0,ans,check=0;
	if(data[0]==hatena){
		for(int i=1;i<12;i++){
			tail+=data[i]*qu(i);
		}
		if(tail%11<=1)ans=0;
		else ans=11-tail%11;
	}else{
		rep(i,10){
			tail=0;
			for(int j=11;j>=1;j--){
				if(data[j]==hatena)tail+=i*qu(j);
				else tail+=data[j]*qu(j);
			}
			if(tail%11<=1 && data[0]==0){
				ans=i;
				check++;
			}
			else if(11-tail%11==data[0]){
				check++;
				ans=i;
			}
		}
	}
	if(check>1)cout<<"MULTIPLE"<<endl;
	else cout<<ans<<endl;
	return 0;
}