#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

map< string, vector<string> > dic;

const int d[] = {2,2,2, 3,3,3, 4,4,4, 5,5,5, 6,6,6, 7,7,7,7, 8,8,8, 9,9,9,9};

inline string toD(string s){
  string res;
  rep(i,s.size())res += (char)('0'+d[s[i]-'a']);
  return res;
}

vector<int> flag;
vector< vector<string> > memo;

vector<string> rec(int p, const string &s){
  vector<string> res;
  if(p == (int)s.size()){
    res.push_back("");
    return res;
  }
  if(flag[p])return memo[p];

  string suf;
  rep(i,50){
    if(p+i>=(int)s.size())break;
    suf += s[p+i];
    if(dic[suf].size()){
      vector<string> tmp = rec(p+i+1,s);
      for(string x : dic[suf]){
	for(string y : tmp){
	  if(y!="")res.push_back(x + " " + y);
	  else res.push_back(x);
	}
      }
    }
  }

  flag[p] = 1;
  return memo[p] = res;
}

int main(){
  int n;
  while(cin >> n, n){
    dic.clear();
    rep(i,n){
      string s;
      cin >> s;
      dic[toD(s)].push_back(s);
    }

    string seq;
    cin >> seq;
    memo.clear(); memo.resize(seq.size());
    flag.clear(); flag.resize(seq.size());
    vector<string> ans = rec(0,seq);

    rep(i,ans.size()){
      cout << ans[i] << ".\n";
    }
    cout << "--\n";
  }
}