using System.Collections.Generic;
public static void Main()
List<string> names = new List<string>();
int count = Convert.ToInt32(Console.ReadLine());
for(int i = 0 ; i < count ; i++){
string name = Console.ReadLine();
List<int> similiarIndexex = new List<int>();
for(int i=0 ; i < names.Count-1 ; i++){
for(int j = i+1 ; j < names.Count ; j++){
if(CheckWords(names[i] , names[j])){
foreach(int k in similiarIndexex){
names.RemoveAt(k - shift);
foreach(string item in names){
public static bool CheckWords(string first , string second){
if(first.Length != second.Length){
foreach(char l in first){
if(second.IndexOf(l) == -1){