package main import "fmt" func main() { var N int fmt.Scan(&N) A := make([][]int, N) R := make([]int, 0) for i := 0; i < N; i++ { var n int fmt.Scan(&n) A[i] = make([]int, n) for j := 0; j < n; j++ { fmt.Scan(&A[i][j]) } } // fmt.Println("A", A) for i := 0; i < 100; i++ { // 列 for j := 0; j < N; j++ { // 行 if i < len(A[j]) { R = append(R, A[j][i]) } } } for _, v := range R { fmt.Print(v, " ") } fmt.Println() }