def ctoi(c): return ord(c) - ord("a") def itoc(i): return chr(ord("a") + i) def deg(s): res = [0] * 26 for c in s: res[ctoi(c)] += 1 return tuple(res) n = int(input()) ss = [input() for _ in range(n)] cnt = {} for s in ss: for c in "abcdefghijklmnopqrstuvwxyz": t = s + c dt = deg(t) if dt in cnt: cnt[dt] += 1 else: cnt[dt] = 1 ans = "-1" for dt in cnt: if cnt[dt] == 1: t = "".join(itoc(i) * dt[i] for i in range(26)) ans = t break print(ans)