A New Word in Advertising
In today's world, offering the surfaces of fences and walls of industrial buildings to advertisers is no longer a novel way to earn extra income; it's now a common practice.
The small company "Domostroy" has decided to join this market by offering advertising space on its fence blocks. Each block is a parallelepiped with dimensions 1×1×L, providing space for advertising on one side—an area of 1×L, where exactly L letters of the Latin alphabet can be inscribed.
Unfortunately, some deals fell through, and pre-prepared blocks with advertisements ended up in the warehouse. Over time, a large number of blocks of various types accumulated there (blocks of different types differ only by the inscription), so it was decided to repurpose them.
The proposed idea is as follows: by stacking several blocks on top of each other, you can read a new text from top to bottom and left to right, as illustrated in the figure.
This way, a new advertising inscription can be created for a client. For aesthetic reasons, gaps in the form of blank letters are not allowed in the final inscription.
Let's describe this process more formally. After stacking a certain number K of blocks, each of length L, you obtain a rectangular table of size K×L, with a letter of the Latin alphabet in each cell. Each advertising block corresponds to a row of this table. The content of this table is then written out by columns, starting from the leftmost one. In each column, the letters are written from top to bottom. In the example shown in the figure, this process results in the string "TOEIIZENITKN". The required advertising inscription must appear as a substring in the resulting string: "TOEIIZENITKN".
Your task is to write a program that determines the minimum number of blocks needed to obtain the required advertising inscription. Assume there is an unlimited supply of each type of block in the warehouse.
Input
The first line of the input file contains two natural numbers N and L—the number of different types of blocks in the warehouse and the length of each block, respectively (1 ≤ N ≤ 100, 1 ≤ L ≤ 100). The next N lines each contain one inscription of length L, consisting of lowercase Latin letters—the inscriptions on the blocks of the corresponding type. The inscriptions on blocks of different types do not match.
The last line of the input file contains the new advertising inscription s—a string consisting only of lowercase Latin letters (1 ≤ |s| ≤ 200). Assume there is an unlimited supply of each type of block in the warehouse.
Output
The first line of the output file should contain a natural number K—the minimum number of blocks needed to create the new advertisement. The next line should contain K numbers—the indices of the block types needed for this, listed from top to bottom. Block types are numbered starting from one in the order they are given in the input file.
If there are multiple solutions, output any one of them. If no solution exists, output the number –1.