/* --- "Start your journey in the name of God." --- */
/* ----- Amit Bhowmik ----- */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using int128 = __int128;
using ull = unsigned long long;
using u32 = unsigned;
const ll mod = 1e9 + 7;
const ll mx = 1e7 + 123;
typedef vector<ll> vl;
#define nl '\n';
typedef long double ld;
#define PB push_back
#define F first
#define S second
#define sz(x) x.size()
#define mid(l,r) ((r+l)/2)
const double PI = acos(-1);
#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sqr(a) ((a) * (a))
#define YES cout << "YES" << nl;
#define NO cout << "NO" << nl;
#define lowerstr(x) transform(all(x),x.begin(), ::tolower)
#define upperstr(x) transform(all(x),x.begin(), ::toupper)
void solve() {
ll m;
cin >> m;
unordered_set<string> str;
string name;
for (ll i = 0; i < m; i++) {
cin >> name;
str.insert(name);
}
ll n; cin >> n;
unordered_set<string> st;
for (ll i = 0; i < n; i++) {
cin >> name;
if (str.find(name) == str.end()) {
cout << "Sorry, not on the list." << nl;
}
else if (st.find(name) == st.end()) {
st.insert(name);
cout << "Welcome!" << nl;
} else {
cout << "Already inside!" << nl;
}
}
return;
}
int main() {
// fast_io;
// ll t; cin >> t;
// while(t--)
solve();
return 0;
}