eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків
Задачі

Kth Sentence

Kth Sentence

Ліміт часу 3 секунди
Ліміт використання пам'яті 64 MiB

m

A student, Kita_masa, is taking an English examination. In this examination, he has to write a sentence of length .

m

K

K

Since he completely forgot the English grammar, he decided to consider all sentences of length constructed by concatenating the words he knows and write the -th sentence among the candidates sorted in lexicographic order. He believes that it must be the correct sentence because is today's lucky number for him.

Each word may be used multiple times (or it's also fine not to use it at all) and the sentence does not contain any extra character between words. Two sentences are considered different if the order of the words are different even if the concatenation resulted in the same string.

Вхідні дані

n

1 ≤ n ≤ 100

m

1 ≤ m ≤ 2000

K

1 ≤ K ≤ 10^18

n

The first line contains three integers (), () and (), separated by a single space. Each of the following lines contains a word that Kita_masa knows. The length of each word is between 1 and 200, inclusive, and the words contain only lowercase letters. You may assume all the words given are distinct.

Вихідні дані

K

m

Print the -th (1-based) sentence of length in lexicographic order. If there is no such a sentence, print "-".

Приклад

Вхідні дані #1
2 10 2
hello
world
Вихідні дані #1
helloworld
Джерело Japan Alumni Group Winter Contest 2012