Return the k most frequent values. Order them by frequency (highest first); break ties by the smaller value first.
Input: line 1 — space-separated integers; line 2 — k. Output: the k values, space-separated.
Your program reads from stdin and prints to stdout.
Example 1
Input: 1 1 1 2 2 3 2
Output: 1 2
Hints