#include <iostream>
#include <string>
#include <vector>
#include <map>

using namespace std;

int n, m;
string bt;
vector<string> vec;
vector<string> res;
map<string, string> mpp;

void conv()
{
  string str;

  for(int i = 0; i < n; ++i){
    str = "";
    for(int j = 0; j < vec[i].size(); ++j){
      if(vec[i][j] <= 'c') str += '2';
      else if(vec[i][j] <= 'f') str += '3';
      else if(vec[i][j] <= 'i') str += '4';
      else if(vec[i][j] <= 'l') str += '5';
      else if(vec[i][j] <= 'o') str += '6';
      else if(vec[i][j] <= 's') str += '7';
      else if(vec[i][j] <= 'v') str += '8';
      else str += '9';
    }
    mpp[vec[i]] = str;
  }
}

void solve(string str, int p)
{
  if(p == m){
    str += ".";
    res.push_back(str);
    return;
  }

  int l;
  for(int i = 0; i < n; ++i){
    l =vec[i].size();
    if(l+p <= m && mpp[vec[i]] == bt.substr(p, l)){
      if(p > 0) solve((str+" "+vec[i]), p+l);
      else solve(vec[i], p+l);
    }
  }
}

int main()
{
  while(cin>>n && n){
    vec = vector<string>(n);
    for(int i = 0; i < n; ++i) cin >> vec[i];
    cin >> bt;

    m = bt.size();
    conv();
    solve("", 0);
    for(int i = 0; i < res.size(); ++i)
      cout << res[i] << endl;
    cout << "--" << endl;

    mpp.clear();
    vec.clear();
    res.clear();
  }

  return 0;
}