def main(): C = input().split() c = C[:] i = c.index('?') for j in ('1', '4'): c[i] = j if c[0] < c[1] > c[2] or c[0] > c[1] < c[2]: print(j, end='') print() main()