#C20. Language Proficiency Table

    ID: 45267 Type: Default 1000ms 256MiB

Language Proficiency Table

Language Proficiency Table

In this problem, you are given a list of developer-language pairs. Your task is to construct a language proficiency table. The table should include a header row starting with the word (\textbf{Language}) followed by the developer names sorted in lexicographical order. Each subsequent row corresponds to a programming language (sorted in lexicographical order) and contains the count (as strings) of how many times each developer appears using that language. Note that if there is no record (or the input is empty), the table should contain only the header row.

Input Format:
The first line contains an integer (n) (with (0 \leq n \leq 10^5)), representing the number of developer-language pairs. Each of the following (n) lines contains two space-separated strings: the developer's name and the programming language.

Output Format:
Output the language proficiency table. The first line is the header row with (\textbf{Language}) and the sorted developer names. Then, for each language (sorted in lexicographical order), print a row that starts with the language name and is followed by the counts corresponding to each developer. Each row should be printed on a new line with items separated by a single space.

inputFormat

The input is read from standard input (stdin). It begins with an integer (n), followed by (n) lines. Each line contains two strings separated by a space: the developer's name and the language they are proficient in.

outputFormat

Print the table to standard output (stdout). The first line is the header beginning with (Language) followed by the sorted developer names. Each subsequent line corresponds to a language (sorted in lexicographical order) followed by the counts for each developer, with values separated by spaces.## sample

7
Alice Python
Bob Java
Cathy Python
Dave Java
Eve C++
Alice C++
Bob Python
Language Alice Bob Cathy Dave Eve

C++ 1 0 0 0 1 Java 0 1 0 1 0 Python 1 1 1 0 0

</p>