#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
long long toNum(string s){
long long num = 0;
for(int i = 0 ; i < s.size() ; i++){
num = (num * 10) + (s[i] - '0');
}
return num;
}
void solve(){
int m, n;
cin >> m;
map<string, int> v,tr;
string s;
for(int i=0;i<m;i++){
cin >> s;
v[s]++;
}
cin >> n;
while(n--){
cin >> s;
if(v[s] && tr[s] == 0){
tr[s]++;
cout << "Welcome!\n";
}else if(v[s] == 0){
cout << "Sorry, not on the list.\n";
}else if(v[s] && tr[s]){
cout << "Already inside!\n";
}
}
}
int main(){
ios_base::sync_with_stdio(0), cin.tie(0);
int t = 1;
// cin >> t;
while(t--){
solve();
}
return 0;
}