#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
#include <stack>
#include <algorithm>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
//typedef pair<int, int> P;
//typedef pair<llong, llong> LP;
//typedef pair<int, P> PP;
//typedef pair<llong, LP> LPP;

int dy[] = { 0, 0, 1, -1, 0 };
int dx[] = { 1, -1, 0, 0, 0 };

int P[12];
int Q[12]{ 6,5,4,3,2,7,6,5,4,3,2,1 };

int main() {
	int n;
	REP(i, 12) {
		char c = getchar();
		if (c == '?') {
			P[i] = -1;
			n = i;
		}
		else P[i] = c-'0';
	}
	int x = 0;
	REP(i, 11) {
		if (P[i] < 0)continue;
		x += P[i] * Q[i];
		x %= 11;
	}
	int ans;
	int ansn = 0;
	if (n != 11) {
		REP(i, 10) {
			int y = x;
			y += i*Q[n];
			if ((y % 11 <= 1 ? 0 : (11 - y % 11)) == P[11]) {
				ans = i;
				ansn++;
			}
		}

	}
	else {
		ans = x % 11 <= 1 ? 0 : (11 - x % 11);
		ansn++;
	}
	if (ansn == 1)printf("%d\n", ans);
	else printf("MULTIPLE\n");
	return 0;
}
