#include #include #include #include using namespace std; string v[26]; char x; string j; int i, maxim=1; map mp; map litere; string tst[10000]; int n; int main() { for(int i=1; i<=26; i++) { cin>>x; cin>>litere[x]; } cin>>n; for(int i=1; i<=n; i++) { j=""; cin>>tst[i]; for(int k=0; kmaxim) maxim=i.second; } if(maxim==1) cout<<-1; else cout<