#P1245. 电话号码

电话号码

Description

On a telephone keypad, several English letters are written under each digit. The mapping is as follows:

  • 1a,b,c1\leftrightarrow \verb!a!,\verb!b!,\verb!c!.
  • 2d,e,f2\leftrightarrow \verb!d!,\verb!e!,\verb!f!.
  • 3g,h,i3\leftrightarrow \verb!g!,\verb!h!,\verb!i!.
  • 4j,k,l4\leftrightarrow \verb!j!,\verb!k!,\verb!l!.
  • 5m,n5\leftrightarrow \verb!m!,\verb!n!.
  • 6o,p,q6\leftrightarrow \verb!o!,\verb!p!,\verb!q!.
  • 7r,s,t7\leftrightarrow \verb!r!,\verb!s!,\verb!t!.
  • 8u,v,w8\leftrightarrow \verb!u!,\verb!v!,\verb!w!.
  • 9x,y,z9\leftrightarrow \verb!x!,\verb!y!,\verb!z!.

Now, given a word list and a sequence of digits (a numeric code), please translate the code using words from the list.

Input Format

The first line contains a positive integer NN indicating the number of words in the list (N100)(N \le 100).

The second line contains a digit string of length at most 100100, representing the code.

The next NN lines each contain one word of length at most 2020, representing the word list.

Output Format

Output a single line: the decoded original text. If the code cannot be translated, output No Solutions!. If there are multiple valid translations, output any one of them.

8
73373711664
thi
shs
this
is
b
a
boo
k
thi shs b boo k

Hint

SPJ provided by @zhouyonglong.

Translated by ChatGPT 5