#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define debug cout<<"check"<<endl;cout.flush();
#define all(x) (x).begin(),(x).end()
#define endl '\n'
const ll N=200005;
const ll mod=1000000007;
const ll INF=2e18L+5;
void solve(){
ll n;
cin>>n;
map<string,int>mp;
for(ll i=0;i<n;i++){
string st;cin>>st;
mp[st]=0;
}
ll q;
cin>>q;
while(q--){
string st;
cin>>st;
if(mp.find(st)==mp.end()){
cout<<"Sorry, not on the list."<<endl;
}
else if(mp[st]==0){
mp[st]=1;
cout<<"Welcome!"<<endl;
}
else{
cout<<"Already inside!"<<endl;
}
}
}
int32_t main(){
ios::sync_with_stdio(false);cin.tie(nullptr);
int t=1;
//cin>>t;
for(int i=1;i<=t;i++){
solve();
}
return 0;
}