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)] for v in s: if s.count(v) == 1: for x in string.ascii_lowercase: if sorted(''.join(v) + x)[:-1] not in s: print(''.join(v) + x) exit() print(-1)