Couples Contest
Couples contest? We didn't plan to hold it during this shift! However, if the director insists it's necessary, then it's necessary. By lunchtime, we managed to survey the entire camp and asked each girl to list all the boys she would be willing to participate with in the contest. How should we select the couples for the contest?
After extensive discussions, we concluded that couples can be formed in any manner, as long as we don't upset the girls. A girl will be upset if she isn't invited to the contest while there is a boy on her list who also isn't invited. She simply won't understand why she wasn't invited to participate, especially since that boy isn't part of any couple either.
Help us compile the list so that no girl gets upset.
Input
The first line contains the numbers n and m (1 ≤ n, m ≤ 100) - the number of girls and boys in the camp, respectively. In the i-th of the following n lines, the list of the i-th girl is provided. The list begins with the number k (1 ≤ k ≤ m) - the number of boys with whom this girl wants to participate in the contest. This is followed by k numbers - the identifiers of these boys. Boys are numbered from 1 to m. All numbers in a line are separated by spaces.
Output
In the first line, print the number c - the number of couples we need to invite to the contest. In each of the following c lines, print the numbers of the girl and the boy that form the next couple, separated by a space. Couples can be printed in any order. If there are multiple ways to compile the list of couples, print any of them. If it's impossible to ensure that no girl gets upset, print "-1".