Write a program that checks whether a given text reaches a goal
number of words of at least a given goal length. The program reads first
the goal number
and the goal length
;
they are integers coming in the first line. Then finds out whether the
text that follows them contains at least
different words of length at least
.
If so, it outputs the
words, sorted according to the standard string ordering, each in a line.
Otherwise, it prints Goal not attained.
Input consists of two numbers and , being respectively the goal number and the goal length, followed by a sequence of words. Numbers and are integers, is greater than zero and is non negative.
In case the goal is achieved, the output consists of
lines with the
first different words in the input text whose length is at least
.
Words are shown according to the standard string order, one by line.
When goal is not reached, a line with the message
Goal not attained
Input
2 4 truck truck bike plane
Output
bike truck
Input
2 5 truck bike truck plane
Output
plane truck
Input
3 5 truck car bike plane
Output
Goal not attained