def winner(conf):
    """
    Function to get the winner of election process.
    :param - conf: Dictionary object mapping node ids to the voting preferences

    return type: char, int
    return: Return candidate ('A','B') followed by the number of votes by which
            the candidate wins.
            If there is a tie, return 'U', 0
    """
    ###########################################################################
    va = 0
    vb = 0
    for i in conf.keys():
        vote = conf[i]
        if vote == 'A':
            va += 1
        elif vote == 'B':
            vb += 1
        else:
            raise Exception("No one should be undecided")
    if va > vb:
        return 'A', va - vb
    elif va < vb:
        return 'B', vb - va
    else:
        return 'U', 0
    ###########################################################################