while(1>0){val (s,r)=readLine.dropRight(1).splitAt(1);println(s+r.min.toString*r.size+s+r.filter{r.min<})}