#abc288b. [abc288_b]Qualification Contest

[abc288_b]Qualification Contest

Problem Statement

There were NN participants in a contest. The participant ranked ii-th had the nickname SiS_i.
Print the nicknames of the top KK participants in lexicographical order.

What is lexicographical order?

Simply put, the lexicographical order is the order of words in a dictionary. As a formal description, below is an algorithm to order distinct strings SS and TT.

Let SiS_i denote the ii-th character of a string SS. We write SltTS \\lt T if SS is lexicographically smaller than TT, and SgtTS \\gt T if SS is larger.

  1. Let LL be the length of the shorter of SS and TT. For i=1,2,dots,Li=1,2,\\dots,L, check whether SiS_i equals TiT_i.
  2. If there is an ii such that SineqTiS_i \\neq T_i, let jj be the smallest such ii. Compare SjS_j and TjT_j. If SjS_j is alphabetically smaller than TjT_j, we get SltTS \\lt T; if SjS_j is larger, we get SgtTS \\gt T.
  3. If there is no ii such that SineqTiS_i \\neq T_i, compare the lengths of SS and TT. If SS is shorter than TT, we get SltTS \\lt T; if SS is longer, we get SgtTS \\gt T.

Constraints

  • 1leqKleqNleq1001 \\leq K \\leq N \\leq 100
  • KK and NN are integers.
  • SiS_i is a string of length 1010 consisting of lowercase English letters.
  • SineqSjS_i \\neq S_j if ineqji \\neq j.

Input

The input is given from Standard Input in the following format:

NN KK S1S_1 S2S_2 vdots\\vdots SNS_N

Output

Print the nicknames, separated by newlines.


Sample Input 1

5 3
abc
aaaaa
xyz
a
def

Sample Output 1

aaaaa
abc
xyz

This contest had five participants. The participants ranked first, second, third, fourth, and fifth had the nicknames abc, aaaaa, xyz, a, and def, respectively.

The nicknames of the top three participants were abc, aaaaa, xyz, so print these in lexicographical order: aaaaa, abc, xyz.


Sample Input 2

4 4
z
zyx
zzz
rbg

Sample Output 2

rbg
z
zyx
zzz

Sample Input 3

3 1
abc
arc
agc

Sample Output 3

abc