v=gets.split a,b=v.map{|i|('%020d'%i).tr'0-9','ABCDJEFIGH'} $><<[0,*v][a<=>b]