from typing import List


def format_board(board: List[str]) -> str:
    """Return the board formatted for output"""

    out_board = ''
    for i in range(0, len(board)):
        if i == 0 or i % 3 == 0:
            out_board += '\n' + '-------------' + '\n|'
        tic = board[i] if board[i] in 'XO' else i + 1
        out_board += f' {tic} |'
    out_board += '\n' + '-' * 13

    return out_board.strip()