#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
#define ff first
#define ss second
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define pii pair<int,int>
#define Fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const int MOD = 1000000007;
const int INF = 1e18;
const int N = 2e5;
void solve(int tc){
int n; cin >> n;
map<string,int>mp,ent;
for(int i=0;i<n;i++){
string s; cin >> s;
mp[s]++;
}
int q; cin >> q;
while(q--){
string s; cin >> s;
if(!mp.count(s))cout << "Sorry, not on the list." << endl;
else {
if(ent.count(s)){
cout << "Already inside!" << endl;
}
else {
cout << "Welcome!" << endl;
ent[s]++;
}
}
}
}
int32_t main(){
Fast
int t=1;
// cin >> t;
for(int tc=1;tc<=t;tc++)
solve(tc);
return 0;
}