package main

import "fmt"

func main() {
    for input := 1; input <= 0x10; input++ {
        for y := input; y > 0; y-- {
            for x := input; x > 0; x-- {
                if x == y || input-x+1 == y ||
                    ((y == 1 || y == input) &&
                        ((input%2 == 1 &&
                            x%2 == 1) ||
                            (input%2 == 0 &&
                                ((x%2 == 1 && x <= input/2) ||
                                    (x%2 == 0 && x > input/2))))) {
                    fmt.Printf("%X", x%0x10)
                } else {
                    fmt.Print(" ")
                }
            }
            fmt.Println()
        }
        fmt.Println()
    }
}