SOLVE
LATER
Little Jhool is back, with his matchmaker friend Dawgie.
Dawgie's logic for approving a girl with a boy or a boy with a girl, is simple: if the name of a girl has maximum similar characters to the name of a guy, they are definitely not fit for being with each other. For example, a couple with Shubhami and Shubham is less ideal than a couple with Shubham and Dhinsat. Since Shubhami and Shubham have 6 characters in common while the other couple has 3 characters in common, so the other couple is much more ideal.
Now our Little Jhool gives the list of all the crushes in his life to Dawgie, and asks him to tell the top K numbers of girls out of the list of N girls, he gives who'll be a good match for Little Jhool.
Note-1: The case of the letters does NOT matter.
Note-2: The name of Little Jhool is: "LittleJhool", without the space and quotes, where the unique characters present in his name are: [l, i, t, e, j,h,o].
Note-3: In case of a tie, print the names in order of their occurrence.
Input format:
The first line contains an integer, T, denoting the number of test-cases possible. The first line for every test case would contain two integers denoting the values of N and K. The next line would contain N names separated by a space.
Output format:
Print the names of the top K girls who will be a good match for our Little Jhool.
Constraints:
1 ≤ Test Cases ≤ \(50\)
1 ≤ N ≤ \(2000\)
1 ≤ K ≤ N.
1 ≤ Length of names ≤ \(26\).
3 5 1 jhoolz littleboy cooldude findingathar findingnemo 3 1 bawa chunnu kundan 3 2 kaddu babykaddu littlejhool
In test number 1, 'cooldude', findingnemo' and findingathar' have 3 common characters. 'jhoolz' has 4 common characters and 'littleboy' has 5 common characters. But since cooldude occurs first, 'cooldude' is the answer.