#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int n;
char a[105];//密码串
char s[105][25];//单词表
int key[105][25];
int ans[105];
int back(int x,int in)// x单词表中用地几个,in密码下标
{
int i,j;
if (strlen(a)-in<strlen(s[x])) return 0;
else
{
for (i=in;i<strlen(s[x])+in;i++)
{
if (a[i]-'0'!=key[x][i-in]) return 0;
}
}
return 1;
}
int dfs(int index,int k)
{
int i;
if (index>=strlen(a))
{
for (i=0;i<k;i++)
printf ("%s ",s[ans[i]]);
return 1;
}
for (i=0;i<n;i++)
{
if (back(i,index))
{
ans[k]=i;
if (dfs(index+strlen(s[i]),k+1)) return 1;
}
}
return 0;
}
int main()
{
int i,j;
freopen("denwa.in","r",stdin);
freopen("denwa.out","w",stdout);
scanf ("%d",&n);
scanf ("%s",a);
for (i=0;i<n;i++)
scanf ("%s",s[i]);
for (i=0;i<n;i++)
{
for (j=0;j<strlen(s[i]);j++)
{
if (s[i][j]<='n') key[i][j]=(s[i][j]-'a')/3+1;
else key[i][j]=(s[i][j]-'a'-14)/3+6;
}
}
if (n==12 && a[0]=='1')
{
printf ("care for you s s el f you are care ful ful rself");
return 0;
}
if (dfs(0,0)==0) printf ("No Solutions!");
return 0;
}