def is_kadomatsu(a,b,c): return a != c and (a < b > c or a > b < c) a = input() for i in ["1","4"]: c = a.replace("?",i) if is_kadomatsu(*map(int,c.split())): print(i,end="") print()