while(0<1)println(readLine split' 'map(_.toInt)sortBy(i=>(-(i+65)%66,i))mkString" ")