from collections import defaultdict, Counter from string import ascii_lowercase N = int(input()) S = [''.join(sorted(input())) for _ in range(N)] if N == 1: print(S[0] + 'z') exit() di = defaultdict(list) for c in ascii_lowercase: for s in S: di[c].append(''.join(sorted(s + c))) for c in ascii_lowercase: for key, val in Counter(di[c]).items(): if val == 1: print(key) exit() print(-1)