10349

This is a bipartite matching problem. This can be solved using Ford fulkerson algorithm for Max flow problem.