def three_to_one_gates_and_measurement_bob(q1, q2, q3):
    """
    Performs the gates and measurements for Bob's side of the 3->1 protocol
    :param q1: Bob's qubit from the first entangled pair
    :param q2: Bob's qubit from the second entangled pair
    :param q3: Bob's qubit from the third entangled pair
    :return: A pair of integer 0/1 indicating Bob's measurement outcomes from measuring the qubits
    """
    q3.cnot(q2)
    q1.cnot(q3)

    #Bell measurement
    q1.cnot(q2)
    q1.H()
    m1 = q1.measure()
    m2 = q2.measure()
    return m1, m2