import sys, time, random from collections import deque, Counter, defaultdict input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) inf = 2 ** 61 - 1 mod = 998244353 import string n = ii() s = [sorted(input()) for _ in range(n)] ts = [] for v in s: for x in string.ascii_lowercase: ts.append(sorted(v + [x])) ts.sort() for v in ts: # v から1文字抜いたものがsに含まれているか cnt = 0 for i in range(len(v)): cnt += s.count(sorted(v[:i] + v[i+1:])) if cnt > 1: break if cnt == 1: print(''.join(v)) exit() print(-1)