#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define PB push_back
#define FI first
#define SE second
#define MP make_pair
#define ALL(cont) cont.begin(), cont.end()

class trienode
{
public:
    trienode *children[256];
    bool word;
    trienode()
    {
        for(int i=0;i<256;i++)
            children[i] = NULL;
        word = false;
    }
};

void insert(trienode *head, string val)
{
    int n = val.length();
    for(int i=0;i<n;i++)
    {
        if(head->children[val[i]]==NULL)
            head->children[val[i]] = new trienode();
        head = head->children[val[i]];
    }
    head->word = true;
}

void recur(trienode *head, string val)
{
    if(head->word==true)
        cout<<val<<endl;
    for(int i=0;i<256;i++)
    {
        if(head->children[i]!=NULL)
            recur(head->children[i],val+((char)i));
    }
}

void query(trienode *head, string val)
{
    int n = val.length();
    for(int i=0;i<n;i++)
    {
        if(head->children[val[i]]==NULL)
        {
            cout<<"No suggestions"<<endl;
            return;
        }
        head = head->children[val[i]];
    }
    recur(head,val);
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    

    int n;
    string x;
    cin>>n;
    trienode *head = new trienode();
    while(n--)
    {
        cin>>x;
        insert(head,x);
    }
    int q;
    cin>>q;
    while(q--)
    {
        cin>>x;
        query(head,x);
    }
    return 0;
 
 
}