n = gets.to_i (1..n).each do |i| l = gets.split(' ').map{|l| l.to_i} l = l[1, l.size - 1] l.sort{ |a, b| b <=> a }.each do |l| print "#{l} " end print "\n" end