#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

int id[12];

bool check(){
  int cd = id[11];
  int sum = 0;
  REP(i,11){
    int q;
    int n = 11-i;
    if(n<=6){
      q = n+1;
    }else{
      q = n-5;
    }
    sum += id[i]*q;
  }
  int amari = sum%11;
  int res = 0;
  if(amari <= 1){
    res = 0;
  }else{
    res = 11-amari;
  }
  return res==cd;
}

int main(){
  string s;
  cin>>s;
  int qu;
  REP(i,12){
    if(s[i]=='?'){
      qu = i;
      id[i] = -1;
    }else{
      id[i] = s[i]-'0';
    }
  }
  vi cand;
  REP(d,10){
    id[qu] = d;
    if(check())cand.push_back(d);
  }
  if(cand.size()==1){
    cout<<cand[0]<<endl;
  }else{
    cout<<"MULTIPLE"<<endl;
  }
  return 0;
}