L = ['1', '4'] C = input().split() A = '' for i in range(3): if C[i] == '?': for l in L: C[i] = l if C[0] != C[1] != C[2] and (max(C) == C[1] or min(C) == C[1]): A += l print(A)