def pine_decoration(card:list): xidx = card.index(-1) def _(num:int): _card = [x for x in card] _card[xidx] = num return max(_card) == _card[1] or min(_card) == _card[1] return _ card = [int(x) if x != "?" else -1 for x in input().split()] pd = pine_decoration(card) have = [1,4] ans = "" for n in have: if pd(n): ans+=str(n) print(ans)