Weekend Lottery

No attempts yetTime limit3sMemory limit128 MB

Problem

Your college classmates decided to organize a private lottery, with draws every Friday. A student who wants to bet chooses $C$ distinct numbers from $1$ to $K$ and pays US $ 1.00 (traditional lotteries such as the US National Lotto use $C = 6$ and $K = 49$). On Friday during lunch, $C$ numbers (also from $1$ to $K$) are drawn. The student whose bet has the largest number of correct guesses receives the amount collected in the bets. This amount is shared in case of ties and accumulates to the next week if no one guessed any of the numbers drawn.

Some of your colleagues do not believe in the laws of probability and asked you to write a program that determines the numbers that have been drawn the fewest times over all previous draws, so that they can bet on those numbers.

Input

The input contains several test cases. The first line of a test case contains three integers $N$, $C$, and $K$: the number of draws that have already happened ($1 \le N \le 10000$), how many numbers make up a bet ($1 \le C \le 10$), and the maximum value of the numbers that can be chosen ($C < K \le 100$). Each of the next $N$ lines contains $C$ distinct integers $X_i$ indicating the numbers drawn in that contest ($1 \le X_i \le K$). The end of the input is indicated by $N = C = K = 0$.

Output

For each test case, write one line containing the set of numbers that have been drawn the fewest times. Print this set as a list in increasing order, with a single space between two consecutive numbers.