import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); char[][] s = new char[n][]; for (int i = 0; i < n; i++) { s[i] = sc.next().toCharArray(); } sc.close(); Map map = new HashMap<>(); for (int i = 0; i < n; i++) { for (char c = 'a'; c <= 'z'; c++) { int len = s[i].length; char[] t = new char[len + 1]; System.arraycopy(s[i], 0, t, 0, len); t[len] = c; Arrays.sort(t); String k = String.valueOf(t); map.put(k, map.getOrDefault(k, 0) + 1); } } for (String k : map.keySet()) { if (map.get(k) == 1) { System.out.println(k); return; } } System.out.println(-1); } }