Group Anagrams

medium
1. You are given an array of strings.
2. You have to group anagrams together.

Note -> Every string consists of lower-case English letters only.

Input Format

A number N str1 str2.. N space-separated strings

Output Format

Every line of output contains space-separated strings which represents a group of anagrams.

Constraints

1 <= N <= 10^4
1 <= length of a string <= 100

Example

Input
5
pepcoding codingpep pepper rapper repepp
Output
codingpep pepcoding 
pepper repepp 
rapper 
Previous
Valid Anagram
Next
Isomorphic Strings

Related Questions