using System.Collections.Generic; using System; public class Hello { static void Main() { var n = int.Parse(Console.ReadLine().Trim()); getAns(n); } static string getT(string s, char c) { s += c; var s2 = s.ToCharArray(); Array.Sort(s2); return new string(s2); } static void getAns(int n) { var d = new Dictionary(); for (int i = 0; i < n; i++) { var s = Console.ReadLine().Trim(); for (int j = 0; j < 26; j++) { var t = getT(s, (char)(j + 'a')); if (d.ContainsKey(t)) d[t]++; else d[t] = 1; } } foreach (var x in d) if (x.Value == 1) { Console.WriteLine(x.Key); return; } Console.WriteLine(-1); } }