for(c<-""*100;s=readLine;t=s split" = "minBy(BigInt(_,c)))println(s.replace(t,"0x"+t))