#include using namespace std; #define ios ios_base::sync_with_stdio(false);cin.tie(0); #define setnow clock_t tStart=clock(); #define time (double)(clock() - tStart)/CLOCKS_PER_SEC; #define setin(x) ifstream cin(x); #define setout(x) ofstream cout(x); typedef long long ll; typedef long long int lli; typedef pair < int, int> dbl; const int maxInt = 1e9*2; const lli maxLong = 1e18*2; map mp; string names[123]; string best; int n; // void check(string str, int i, int j){ if(i == j && (unsigned) == str.size()){ if(str.size() > best.size()) best = str; return; } while((unsigned)j < str.size()){ string sub; for(int k=i;k<=j;k++) sub+=str[k]; if(mp[sub]) check(str, j+1, j+1); j++; } } int main(){ //ifstream cin("input.in"); cin >> n; for(int i=0;i> names[i]; mp[names[i]] = true; } for(int i=0;i 0) cout << best; else cout << -1; return(0); }