#include using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, j = 0; cin >> n; vector a(n), S(26 * n); for(auto &&s : a){ cin >> s; sort(s.begin(), s.end()); for(char c = 'a'; c <= 'z'; c++){ S[j] = s; S[j].insert(upper_bound(S[j].begin(), S[j].end(), c), c); j++; } } sort(S.begin(), S.end()); for(int i = 0; i < S.size(); ){ int p = i; while(i < S.size() && S[i] == S[p]) i++; if(i - p == 1){ cout << S[p] << '\n'; return 0; } } cout << -1 << '\n'; }