mon = [i for i in input().split()] qn = mon.index("?") for i in ["1", "4"]: mon[qn] = i mon = list(map(lambda x: int(x), mon)) if (mon[1] == max(mon)) or (mon[1] == min(mon)): print(i,end="")