Farmer John has no large brown cow

No attempts yetTime limit1sMemory limit128 MB

Problem

Farmer John wants to collect as many different kinds of cows as he can. He already has almost every kind imaginable, and the kinds he is missing fit on a short list of NN lines (1N1001 \le N \le 100). The list looks like this:

  • Farmer John has no large brown noisy cow.
  • Farmer John has no small white silent cow.
  • Farmer John has no large spotted noisy cow.

Each line describes one missing kind of cow with a few adjectives. Every line uses the same number of adjectives, three in the list above. A line has between 2 and 30 adjectives.

The adjectives that can appear in a position are exactly the ones that appear in that position somewhere on the list. Above, the first position is large or small, the second is brown, white, or spotted, and the third is noisy or silent. That gives 2×3×2=122 \times 3 \times 2 = 12 combinations, and Farmer John has a cow for every combination except the three on his list. A large white noisy cow is one of his 9 cows. Farmer John has at most 1,000,000,000 cows.

List Farmer John's cows in alphabetical order and find the KKth one.

Input

  • Line 1: two integers NN and KK.
  • Lines 2 to 1+N1+N: each line is a sentence of the form "Farmer John has no large spotted noisy cow.". Every adjective in the sentence is a string of at most 10 lowercase letters. The sentence ends at the string "cow." with the period.
  • KK is at least 1 and at most the number of cows Farmer John has.

Output

  • Line 1: the adjectives of the KKth cow, in position order, separated by single spaces. Print the adjectives only, with no surrounding sentence and no period.

Hint

Take the list from the statement with K=7K = 7. Farmer John's cows in alphabetical order are:

  • large brown silent
  • large spotted silent
  • large white noisy
  • large white silent
  • small brown noisy
  • small brown silent
  • small spotted noisy
  • small spotted silent
  • small white noisy

The 7th of these is small spotted noisy.