CSES - E4590 2017 2 - Anagrams
  • Time limit: 5.00 s
  • Memory limit: 750 MB

Teemu has found a dictionary and now he wonders which words are anagrams. Two words are anagrams, if they can be transformed into each other by rearranging the letters within each word. We call an anagram group a group of two or more words such that each word in the group is an anagram with every other word.

Help Teemu by writing a program to find all anagram groups in the dictionary.

Input

The first line of the input contains single integer nn, the number of words in the dictionary. Following nn lines each contain single word in the dictionary sis_i.

Output

On the first line of the output, write the number of anagram groups in the dictionary. After that write a description for each anagram group.

A description of an anagram group starts with a single line containing the number of words in the group. After that follows each word in the group on their own lines. See example for help.

You can output the anagram group descriptions and words inside each group in any order.

Limits

  • 1n41051 \le n \le 4\cdot10^5
  • 1length(si)321 \le \text{length}(s_i) \le 32
  • Total length of all words 5106\le 5\cdot10^6
  • All words are unique
  • The words consist of letters a-z

Example

Input:

5
bacterial
silent
calibrate
coffee
listen

Output:

2
2
bacterial
calibrate
2
silent
listen