def copy_board(board):
    """ Deep-copies the input board (sudoku or domain)
    """
    new_board = []

    # Copy sudoku
    if type(board[0][0]) == int:
        for row in board:
            new_board.append(row[:])

    # Copy domain
    else:
        for grid in board:
            new_grid = []
            for row in grid:
                new_grid.append(row[:])
            new_board.append(new_grid)

    return new_board