Vasya has several phone books, in which he recorded the telephone numbers of his friends. Each of his friends can have one or several phone numbers.
Vasya decided to organize information about the phone numbers of friends. You will be given _n_ strings — all entries from Vasya's phone books. Each entry starts with a friend's name. Then follows the number of phone numbers in the current entry, and then the phone numbers themselves. It is possible that several identical phones are recorded in the same record.
Vasya also believes that if the phone number _a_ is a suffix of the phone number _b_ (that is, the number _b_ ends up with _a_), and both numbers are written by Vasya as the phone numbers of the same person, then _a_ is recorded without the city code and it should not be taken into account.
The task is to print organized information about the phone numbers of Vasya's friends. It is possible that two different people have the same number. If one person has two numbers _x_ and _y_, and _x_ is a suffix of _y_ (that is, _y_ ends in _x_), then you shouldn't print number _x_. If the number of a friend in the Vasya's phone books is recorded several times in the same format, it is necessary to take it into account exactly once.
Read the examples to understand statement and format of the output better.
## Input
First line contains the integer _n_ (1 ≤ _n_ ≤ 20) — number of entries in Vasya's phone books.
The following _n_ lines are followed by descriptions of the records in the format described in statement. Names of Vasya's friends are non-empty strings whose length does not exceed 10. They consists only of lowercase English letters. Number of phone numbers in one entry is not less than 1 is not more than 10. The telephone numbers consist of digits only. If you represent a phone number as a string, then its length will be in range from 1 to 10. Phone numbers can contain leading zeros.
## Output
Print out the ordered information about the phone numbers of Vasya's friends. First output _m_ — number of friends that are found in Vasya's phone books.
The following _m_ lines must contain entries in the following format "_name number_of_phone_numbers phone_numbers_". Phone numbers should be separated by a space. Each record must contain all the phone numbers of current friend.
Entries can be displayed in arbitrary order, phone numbers for one record can also be printed in arbitrary order.
[samples]
Vasya 有若干电话簿,其中记录了他朋友的电话号码。他的每个朋友可能有一个或多个电话号码。
Vasya 决定整理关于朋友电话号码的信息。你将获得 #cf_span[n] 个字符串——所有来自 Vasya 电话簿的条目。每个条目以朋友的名字开头,接着是当前条目中电话号码的数量,然后是电话号码本身。同一个条目中可能记录了多个相同的电话号码。
Vasya 还认为,如果电话号码 #cf_span[a] 是电话号码 #cf_span[b] 的后缀(即,号码 #cf_span[b] 以 #cf_span[a] 结尾),且这两个号码都被 Vasya 记录为同一个人的电话号码,则 #cf_span[a] 是未带区号的号码,不应被计入。
你的任务是打印出 Vasya 朋友电话号码的整理信息。不同的人可能拥有相同的号码。如果一个人有两个号码 #cf_span[x] 和 #cf_span[y],且 #cf_span[x] 是 #cf_span[y] 的后缀(即,#cf_span[y] 以 #cf_span[x] 结尾),则不应输出号码 #cf_span[x]。如果某个朋友的号码在 Vasya 的电话簿中以相同格式被多次记录,则只应计算一次。
请阅读示例以更好地理解题意和输出格式。
第一行包含整数 #cf_span[n](#cf_span[1 ≤ n ≤ 20])——Vasya 电话簿中的条目数量。
接下来的 #cf_span[n] 行为按题面描述格式的记录。Vasya 朋友的名字是非空字符串,长度不超过 #cf_span[10],仅由小写英文字母组成。每个条目中的电话号码数量不少于 #cf_span[1],不多于 #cf_span[10]。电话号码仅由数字组成。若将电话号码表示为字符串,则其长度在 #cf_span[1] 到 #cf_span[10] 之间。电话号码可以包含前导零。
请输出整理后的 Vasya 朋友电话号码信息。首先输出 #cf_span[m] —— 在 Vasya 电话簿中找到的朋友数量。
接下来的 #cf_span[m] 行必须按以下格式输出条目:“_name number_of_phone_numbers phone_numbers_”。电话号码之间用空格分隔。每个条目必须包含当前朋友的所有电话号码。
条目可以任意顺序输出,每个条目中的电话号码也可以任意顺序打印。
## Input
第一行包含整数 #cf_span[n](#cf_span[1 ≤ n ≤ 20])——Vasya 电话簿中的条目数量。接下来的 #cf_span[n] 行为按题面描述格式的记录。Vasya 朋友的名字是非空字符串,长度不超过 #cf_span[10],仅由小写英文字母组成。每个条目中的电话号码数量不少于 #cf_span[1],不多于 #cf_span[10]。电话号码仅由数字组成。若将电话号码表示为字符串,则其长度在 #cf_span[1] 到 #cf_span[10] 之间。电话号码可以包含前导零。
## Output
请输出整理后的 Vasya 朋友电话号码信息。首先输出 #cf_span[m] —— 在 Vasya 电话簿中找到的朋友数量。接下来的 #cf_span[m] 行必须按以下格式输出条目:“_name number_of_phone_numbers phone_numbers_”。电话号码之间用空格分隔。每个条目必须包含当前朋友的所有电话号码。条目可以任意顺序输出,每个条目中的电话号码也可以任意顺序打印。
[samples]
**Definitions**
Let $ n \in \mathbb{Z} $ be the number of entries.
Let $ E = \{ ( \text{name}_i, P_i ) \mid i \in \{1, \dots, n\} \} $ be the set of entries, where:
- $ \text{name}_i \in \Sigma^{*} $, $ \Sigma = \{a, b, \dots, z\} $, $ 1 \leq |\text{name}_i| \leq 10 $,
- $ P_i = (p_{i,1}, p_{i,2}, \dots, p_{i,k_i}) $, $ k_i \in \{1, \dots, 10\} $, each $ p_{i,j} \in \{0,1,\dots,9\}^{*} $, $ 1 \leq |p_{i,j}| \leq 10 $.
Let $ F $ be the multiset of friend-phone associations:
$ F = \bigcup_{i=1}^n \{ (\text{name}_i, p) \mid p \in P_i \} $.
**Constraints**
1. $ 1 \leq n \leq 20 $
2. For all entries:
- $ 1 \leq |P_i| \leq 10 $
- Each phone number is a non-empty string of digits (may have leading zeros)
- Names are non-empty strings of lowercase English letters
**Reduction Rule**
For each friend $ \text{name} $, let $ S_{\text{name}} = \{ p \mid (\text{name}, p) \in F \} $.
Define the reduced set $ R_{\text{name}} \subseteq S_{\text{name}} $ as:
$$ R_{\text{name}} = \left\{ p \in S_{\text{name}} \mid \nexists q \in S_{\text{name}},\ q \neq p,\ \text{such that } p \text{ is a suffix of } q \right\} $$
**Objective**
Compute the set of unique friends with reduced phone sets:
$$ \mathcal{F} = \left\{ (\text{name}, R_{\text{name}}) \mid \text{name} \in \text{dom}(F) \right\} $$
Output:
- $ m = |\mathcal{F}| $
- For each $ (\text{name}, R_{\text{name}}) \in \mathcal{F} $, output:
$ \text{name} \quad |R_{\text{name}}| \quad p_1 \ p_2 \ \dots \ p_{|R_{\text{name}}|} $
where $ p_1, \dots, p_{|R_{\text{name}}|} $ are the elements of $ R_{\text{name}} $ in arbitrary order.