package main import ( "fmt" "sort" ) func sum[T int | float64](nums []T) T { var sum T for _, n := range nums { sum += n } return sum } func reverse(s string) string { var r []rune = []rune(s) for i, j := 0, len(r)-1; i < j; i, j = i+1, j-1 { r[i], r[j] = r[j], r[i] } return string(r) } func main() { var N int fmt.Scan(&N) var S []string = make([]string, N) for i := 0; i < N; i++ { var t string fmt.Scan(&t) r := []rune(t) sort.Slice(r, func(i, j int) bool { return r[i] < r[j] }) S[i] = string(r) } sort.Slice(S, func(i, j int) bool { return S[i] < S[j] }) var not_ans []bool = make([]bool, N) for i := 0; i < N-1; i++ { if S[i] == S[i+1] { not_ans[i] = true not_ans[i+1] = true } } for i, v := range not_ans { if !v { fmt.Println(S[i] + "a") return } } fmt.Println(-1) }