def budget_equalities(sequence:str, price_vars:list, budget_vars:list)->list:
    """
    Given a picking-sequence, create symbolic equalities determining that the
    total price of each agent's bundle equals the agent's budget.
    Currently works only for 2 agents.

    :param sequence:  a string determining the picking-sequence, e.g. "ABA".
    :param price_vars:    a list of symbols, e.g. symbols('p3,p2,p1')
    :param budgets:   a list of symbols, e.g. symbols('a,b')
    :return: a list of constraints, as expressions that should be equal to 0.

    >>> budgets = symbols("a,b")
    >>> price_vars = symbols('p5,p4,p3,p2,p1')
    >>> budget_equalities("ABABA", price_vars, budgets)
    [a - p1 - p3 - p5, b - p2 - p4]
    >>> budget_equalities("AABBB", price_vars, budgets)
    [a - p4 - p5, b - p1 - p2 - p3]
    """
    num_agents = len(budget_vars)
    if num_agents!=2:
        raise ValueError("Currently only 2 agents are supported")

    price_equality_a = budget_vars[0]
    price_equality_b = budget_vars[1]
    for i in range(len(sequence)):
        picker = sequence[i]
        if picker=="A":
            price_equality_a -= price_vars[i]
        elif picker=="B":
            price_equality_b -= price_vars[i]
        else:
            raise ValueError("Found picker {} but only two agents are supported".format(picker))
    return [price_equality_a,price_equality_b]