There are a N students in a high school class. For simplicity the students are named A, B, C, . . . (up to the Nth letter of the alphabet). No two students have exactly the same height.
The Principal of the school wants to organize a class photograph where the students are arranged in descending order of heights. The class teacher has been asked to list the students in descending order of heights to send to the photographer.
The teacher does not know the heights of the various students. However, there are a set of photographs, which between them have all the students in that class. From each of the photographs the teacher obtained a list of students in descending height order, and needs to combine them into one list of students in descending height order.
It is possible that the photographs do not fully determine the ordering in the list. In this case, as it is vacation time, the teacher needs to write to some of the students to send her their exact height, so that she can create the complete list.
The objective is to write a program that can list the students to whom she must write to determine their heights.
Constraints
N<=26, K<=10
Input Format
Line 1 contains two comma separated positive integers, N and K. N gives the number of students in the class (A,B,C, . . .), and K is the number of photographs
The next K lines each contain a comma separated list of the students in descending order from the corresponding photograph.
Output
Output should be one comma separated list (in alphabetical order) of students whose height must be known to create the ordered list. If it is not necessary to write to any student, the output should be N/A
The Principal of the school wants to organize a class photograph where the students are arranged in descending order of heights. The class teacher has been asked to list the students in descending order of heights to send to the photographer.
The teacher does not know the heights of the various students. However, there are a set of photographs, which between them have all the students in that class. From each of the photographs the teacher obtained a list of students in descending height order, and needs to combine them into one list of students in descending height order.
It is possible that the photographs do not fully determine the ordering in the list. In this case, as it is vacation time, the teacher needs to write to some of the students to send her their exact height, so that she can create the complete list.
The objective is to write a program that can list the students to whom she must write to determine their heights.
Constraints
N<=26, K<=10
Input Format
Line 1 contains two comma separated positive integers, N and K. N gives the number of students in the class (A,B,C, . . .), and K is the number of photographs
The next K lines each contain a comma separated list of the students in descending order from the corresponding photograph.
Output
Output should be one comma separated list (in alphabetical order) of students whose height must be known to create the ordered list. If it is not necessary to write to any student, the output should be N/A