import sys sys.setrecursionlimit(5*10**5) input = sys.stdin.readline from collections import defaultdict, deque, Counter from heapq import heappop, heappush from bisect import bisect_left, bisect_right from math import gcd def sti(s): res = [] for c in s: res.append(ord(c) - ord('a')) return res def its(s): res = [] for i in s: res.append(chr(i + ord('a'))) return res n = int(input()) s = [] d = defaultdict(int) for i in range(n): si = sti(input().rstrip()) si.sort() s.append(si) d["".join(its(si))] += 1 for i in range(n): for j in range(26): new = s[i] + [j] new.sort() cnt = 0 for k in range(len(new)): tmp = new[:k] + new[k+1:] cnt += d["".join(its(tmp))] if cnt == 1: print("".join(its(new))) exit() print(-1)