#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define double long double
// const int MOD = 998244353;
const int N = 1e6 + 9;
// const uint M=(1<<31)
// int pref_xor[N];
// int a[N];
// int cnt[30][2];
// vector<int>v(n);
// bitset<M>a;
// vector<int> v(n + 1);
bool vis[N];
void pari_na_kisu()
{
int n;
cin >> n;
vector<string> v;
map<string, int> mp;
for (int i = 1; i <= n; i++)
{
string s;
cin >> s;
v.push_back(s);
mp[s]++;
}
int q;
cin >> q;
while (q--)
{
string k;
cin >> k;
if (mp[k] == 0)
{
cout << "Sorry, not on the list.\n";
}
else
{
if (mp[k] == 1)
{
cout << "Welcome!\n";
mp[k]++;
}
else
{
cout << "Already inside!\n";
}
}
}
}
int32_t main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
// cout << "Case " << (++cs) << ": ";
pari_na_kisu();
}