Problem: You are the developer of a dating app which ignores gender completely. The app has users, indexed from to . Each user's profile features a list of the activities they enjoy doing. There are possible activities, indexed from to .
A match between two users is good if they share at least one activity and, at the same time, both of them like at least one activity that the other user does not like.
Find a good match if it exists.
Input Format: The first line contains two integers and (, ) — the number of users and the number of activities.
Each of the following lines contains a number () — the number of activities that user likes — followed by distinct integers from to — the activities user likes.
It is guaranteed that does not exceed .
Output Format: Print if a good match exists. Otherwise, print .
If a good match exists, on the next line print two integers — the indexes of two users that make a match.
Note: In the first sample, users and form a match, because they share activity , and, furthermore, user likes activity (which user does not like) and user likes activity (which user does not like). Note that users and , as well as users and , do not form a match, as there is no activity that users or like, and user doesn't like.