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