#include using namespace std; typedef long long ll; void solve() { ll n; cin >> n; map mp; vector S; for (ll i = 0; i < n; ++i) { string s; cin >> s; sort(s.begin(), s.end()); S.push_back(s); } for (ll i = 0; i < n; ++i) { for (char c = 'a'; c <= 'z'; ++c) { string tmp(S[i]); tmp.push_back(c); ++mp[tmp]; } } for (auto m : mp) { if (m.second == 1) { cout << m.first << endl; return; } } cout << -1 << endl; } int main() { solve(); return 0; }