// start: 10:34
// stop: 10:43
// start: 10:50
// stop: 11:22
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cctype>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <sstream>
#include <deque>

#define REP(i, n) for ( int i = 0; i < n; i++ )

using namespace std;

map<char, vector<char> > table;
// map<string, int> close;

struct input {
    int idx;
    string str;
    string current;
    vector<string> words;
};

// なければ空文字列を返す？
bool in_dictionary(vector<string> &dict, string word) {
    REP(i, dict.size()) {
        if ( dict[i] == word ) {
            return true;
        }
    }
    return false;
}

bool dict_match(vector<string> &dict, string word) {
    REP(i, dict.size()) {
        int match = 0;
        REP(j, word.size()) {
            if(dict[i][j] == word[j]) match++;
            else break;
        }
        if(match == word.size()) {
            // cout << word << " match: " << dict[i] << endl;
            return true;
        }
    }
    // cout << word << " is not match." << endl;
    return false;
}

void dump(vector<string> &arr) {
    REP(i, arr.size()) {
        cout << arr[i] << " ";
    }
    cout << endl;
}

string join(vector<string> &arr, string glue = " ") {
    string ret = arr[0];
    for(int i = 1; i < arr.size(); i++) {
        ret += glue + arr[i];
    }
    return ret;
}

vector<string> decode(vector<string> &dict, string line) {
    vector<string> ret(1);

    queue<input> inputs;
    struct input init = {0, "", "", vector<string>()};

    inputs.push(init);

    while(!inputs.empty()) {
        struct input inp = inputs.front(); inputs.pop();

        string key = inp.str + inp.current;
        // if(close[key]) continue;
        // close[key] = 1;

        if(inp.idx >= line.size() && inp.current == "") {
            ret.push_back(join(inp.words));
            // cout << "end of parse!!!!! " << ret.size() << endl;
            // dump(ret);
            // break;
        }

        REP(i, table[line[inp.idx]].size()) {
            string tmp_current = inp.current, tmp_str = inp.str;
            vector<string> tmp_words = inp.words;

            tmp_current += table[line[inp.idx]][i];
            tmp_str += table[line[inp.idx]][i];

            // cout << tmp_current << " in-dic:" << in_dictionary(dict, tmp_current) << endl;
            if(in_dictionary(dict, tmp_current)) {
                string match_current = tmp_current;
                vector<string> match_words = tmp_words;

                match_words.push_back(match_current);
                match_current = "";
                // cout << inp.idx+1 <<  " add dump: ";
                // dump(match_words);

                struct input match_inp = {inp.idx+1, tmp_str, match_current, match_words};
                inputs.push(match_inp);
            }

            // cout << tmp_current << " " << dict_match(dict, tmp_current) << endl;
            if(inp.idx <= line.size() && dict_match(dict, tmp_current)) {
                struct input new_inp = {inp.idx+1, tmp_str, tmp_current, tmp_words};
                inputs.push(new_inp);
            }
        }
    }

    return ret;
}

// vector<string> convert(input inp) {

// }

int main() {
    int n;
    table['2'] = vector<char>(3);
    table['3'] = vector<char>(3);
    table['4'] = vector<char>(3);
    table['5'] = vector<char>(3);
    table['6'] = vector<char>(3);
    table['7'] = vector<char>(4);
    table['8'] = vector<char>(3);
    table['9'] = vector<char>(4);

    table['2'][0] = 'a';
    table['2'][1] = 'b';
    table['2'][2] = 'c';
    table['3'][0] = 'd';
    table['3'][1] = 'e';
    table['3'][2] = 'f';
    table['4'][0] = 'g';
    table['4'][1] = 'h';
    table['4'][2] = 'i';
    table['5'][0] = 'j';
    table['5'][1] = 'k';
    table['5'][2] = 'l';
    table['6'][0] = 'm';
    table['6'][1] = 'n';
    table['6'][2] = 'o';
    table['7'][0] = 'p';
    table['7'][1] = 'q';
    table['7'][2] = 'r';
    table['7'][3] = 's';
    table['8'][0] = 't';
    table['8'][1] = 'u';
    table['8'][2] = 'v';
    table['9'][0] = 'w';
    table['9'][1] = 'x';
    table['9'][2] = 'y';
    table['9'][3] = 'z';

    while(cin >> n, n) {
        vector<string> dict(n);
        string line;

        // close.clear();

        REP(i, n) {
            cin >> dict[i];
        }

        cin >> line;

        vector<string> results = decode(dict, line);
        REP(i, results.size()) {
            if ( results[i] != "" ) cout << results[i] << "." << endl;
        }
        cout << "--" << endl;
    }   
    return 0;
}