N = int(input()) dic = {} for i in range(N): S = list(input()) S.sort() nex = "".join(S) if nex in dic: dic[nex] += 1 else: dic[nex] = 1 #print(dic) abc = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] for ind,val in dic.items(): if val == 1: nex2 = list(ind) for j in abc: nex3 = nex2 + [j] nex3.sort() nex4 = "".join(nex3) if nex4 not in dic: print(nex4) exit() print(-1)