After computing max flow, extract the pairs by looking at the flow on edges between boys and girls. If , then boy and girl are paired. Only edges with flow represent actual pairs.
Edges with flow are unused preferences. Output all such pairs. The count equals the max flow value. This extracts the matching from the flow solution. The flow values directly represent the pairing.