#include <bits/stdc++.h>
using namespace std;
int a[100005];
set<int> s;
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) {
    int x;
    scanf("%d", &x);
    s.insert(x);
  }
  for (int i = 0, pre = 0, flag = 0; i < k; ++i) {
    if (flag) {
      printf("0\n");
      continue;
    }
    auto it = s.upper_bound(pre);
    if (it == s.end()) {
      flag = 1;
      printf("0\n");
      continue;
    }
    printf("%d\n", *it - pre);
    pre = *it;
  }
  return 0;
}
