while 1:R=raw_input();exec["%s=min(R)","print R.replace('?',%s)"]['?'in R]%max(R)