#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200000;
int n, k, v[MAXN + 10];
bool can(int fr) {
  int qtd = 0;
  for (int i = 0; i <= MAXN; ++i) qtd += v[i] / fr;
  return qtd >= k;
}
inline int bs() {
  int lo = 1;
  int hi = n / k;
  while (lo < hi) {
    int mid = (lo + hi) / 2;
    if (can(mid))
      lo = mid;
    else
      hi = mid - 1;
    if (can(hi))
      lo = hi;
    else
      hi--;
  }
  return lo;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> k;
  for (int i = 0, x; i < n; ++i) {
    cin >> x;
    v[x]++;
  }
  int lo = bs();
  for (int i = 0; i <= MAXN; ++i) {
    while (v[i] >= lo) {
      if (k > 1)
        cout << i << " ";
      else {
        cout << i << endl;
        return 0;
      }
      k--;
      v[i] -= lo;
    }
  }
  return 0;
}
