Mr. A has finally found the love of his life. Being a love expert Mr. P has given Mr. A an idea to write a love letter. But he is very weak in this matter. So he took help from his friends. He has friends. Each friend has given him one romantic sentence and using all those sentences Mr. A will write a love letter.
Each sentence contains only lower case alphabet (‘a’- ‘z’) and space. The height of each character is 1 and the width of each character is also 1.
But Mr. A is very busy person, So Mr. A has given me the duty to arrange the sentences and make a love letter. He has also given me an size paper. Now I have to write all the sentences in that paper. But Mr. P has advised me not to write more than two sentences in a row and write in only one side of the paper. He also advised me not to write any sentence using more than one row. So, in order to fit the sentences, I will remove all the spaces and also I will not use any space between two lines.
Now I'm in a dangerous situation, if I refuse to do this work Mr. A will break my legs but if I do the work and something goes wrong he will break my legs too. So I've decided to do this work and hide for a few days. As I'm busy packing my bag i want you to do a job for me.
You will be given N and M, the height and width of the paper, and sentences. You will have to tell me can I write all the sentences in that paper in any order or not.
The first line of the input set will contain two integers and ().
The next lines will contain a sentence each, not containing more than 1000 characters.
If I can write all these sentences in the paper in any order, output and if I can’t output .
2 6 a a a b b b c c c d d d
2 28 akasata meg ura dakta laga sada bondu amar balobasay nai kuno kada