def k(a): return a[1] == min(a) or a[1] == max(a) s = input() t = s.replace("?", "1") a = list(map(int, t.split())) if k(a): print(1, end="") t = s.replace("?", "4") a = list(map(int, t.split())) if k(a): print(4, end="") print()