a=list(map(str,input().split())) n=a.index("?") ans = "" a[n]="1" if a[1] == min(a) or a[1] == max(a): ans += "1" a[n]="4" if a[1] == min(a) or a[1] == max(a): ans += "4" print(ans)