package main
import "fmt"
func main() {
var n int
fmt.Scan(&n)
matrix := make([][]int, n)
for i := range matrix {
s := make([]int, n)
matrix[i] = s
for j := range s {
if j < n-1-i {
s[j] = 0
} else if j > n-1-i {
s[j] = 2
} else {
s[j] = 1
}
}
}
for i := 0; i < len(matrix); i++ {
for j := 0; j < len(matrix[i]); j++ {
if j < len(matrix[i])-1 {
fmt.Print(matrix[i][j], " ")
} else {
fmt.Print(matrix[i][j])
}
}
if i < len(matrix)-1 {
fmt.Printf("\n")
}
}
}