This problem taught you the basic template for Kuhn's algorithm. You saw how to build the bipartite graph from input, implement the DFS search for augmenting paths, and reconstruct the solution from the matching array. Takeaway: bipartite matching problems reduce to finding augmenting paths.
Once you have this code template working, you can adapt it to many other problems with only minor changes to the input parsing and output formatting.