Go read the problem statement on CSES right now. Notice the constraints: and up to potential pairs. This is small enough for Kuhn's algorithm. Pay attention to what the input gives you: the number of boys, the number of girls, and a list of valid pairs (boy index, girl index).
Your output should be the maximum matching size on the first line, followed by the actual pairs.