// No.1475 時計の歯車Easy package main import ( "bufio" "fmt" "os" "slices" "strconv" "strings" ) var sc = bufio.NewScanner(os.Stdin) var wr = bufio.NewWriter(os.Stdout) func next() string { sc.Scan() return sc.Text() } func nextInt() int { i, _ := strconv.Atoi(next()) return i } func nextFloat() float64 { f, _ := strconv.ParseFloat(next(), 64) return f } func nextInts(n int) []int { ret := make([]int, n) for i := 0; i < n; i++ { ret[i] = nextInt() } return ret } func nextFloats(n int) []float64 { ret := make([]float64, n) for i := 0; i < n; i++ { ret[i] = nextFloat() } return ret } func nextStrings(n int) []string { ret := make([]string, n) for i := 0; i < n; i++ { ret[i] = next() } return ret } func main() { sc.Split(bufio.ScanLines) var n int = nextInt() var x = make([]string, n) for i := 0; i < n; i++ { x[i] = next() } var f = func(s string) []int { ss := strings.Split(s, " ") is := make([]int, len(ss)-1) for i, v := range ss { if i == 0 { continue } is[i-1], _ = strconv.Atoi(v) } return is } for j := 0; j < n; j++ { y := f(x[j]) slices.Sort(y) slices.Reverse(y) yy := make([]string, len(y)) for i, v := range y { yy[i] = strconv.Itoa(v) } fmt.Println(strings.Join(yy, " ")) } }