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() words = [] for c in ascii_lowercase: for s in S: words.append(''.join(sorted(s + c))) for c in ascii_lowercase: for key, val in Counter(words).items(): if val == 1: print(key) exit() print(-1)