n = int(input()) s = [] for i in range(n): s.append(''.join(sorted(input()))) s.sort() if n == 1: print(s[0] + "a") else: f = True for i in range(n-1): a, b = s[i], s[i+1] if a == b: continue if len(a) < len(b): print(a + "a") else: for j in range(len(a)): if a[j] != b[j]: for c in "abcdefghijklmnopqrstuvwxyz": if c != a[j] and c != b[j]: print(a+c) break break f = False break if f: print(-1)