a = input().split() b = a c = a.index("?") d = "" for i in ["1","4"]: b[c] = i if(b.index(min(b)) ==1 or b.index(max(b)) == 1): d = d+i print(d)