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