#include using namespace std; #define all(v) (v).begin(),(v).end() #define pb(a) push_back(a) #define rep(i, n) for(int i=0;i> n; vector s(n); rep(i, n) { cin >> s[i]; } string t = ""; map mp; rep(i, n) { string u = s[i]; rep(j, 26) { string S = u + char('a' + j); sort(all(S)); mp[S] ++; } } for(auto [x, cnt] : mp) { if(cnt == 1) { cout << x << endl; return 0; } } cout << -1 << endl; return 0; }