import copy


def transform_board(board,a=1,b=2,f=1,s=-1):
    """
    Map 1 -> -1 and 2 -> 1
    This is done so that we can easily get the canonical board easily
    """
    return_board = copy.deepcopy(board)
    for i in range(len(board)):
        for j in range(len(board[0])):
            curr = board[i][j]
            if curr == a:
                return_board[i][j] = f
            elif curr == b:
                return_board[i][j] = s
    return return_board