#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T gi() {
  T f = 1, x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return f * x;
}
const int INF = 0x3f3f3f3f, N = 2000003, M = N << 1, mod = 924844033;
int n, k;
int limit, l;
int rev[N];
inline long long qpow(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y & 1) res = res * x % mod;
    x = x * x % mod, y >>= 1;
  }
  return res;
}
inline void NTT(int *a, int f) {
  for (int i = 0; i < limit; i += 1)
    if (i < rev[i]) swap(a[i], a[rev[i]]);
  for (int i = 1; i < limit; i <<= 1) {
    long long gn = qpow(5, (mod - 1) / (i << 1));
    for (int p = i << 1, j = 0; j < limit; j += p) {
      long long g = 1;
      for (int k = 0; k < i; k += 1, g = g * gn % mod) {
        long long x = a[j + k], y = g * a[i + j + k] % mod;
        a[j + k] = (x + y) % mod, a[i + j + k] = (x - y + mod) % mod;
      }
    }
  }
  if (f == 1) return;
  reverse(a + 1, a + limit);
  long long inv = qpow(limit, mod - 2);
  for (int i = 0; i < limit; i += 1) a[i] = a[i] * inv % mod;
  return;
}
int a[N];
int main() {
  n = gi<int>(), k = gi<int>();
  for (int i = 1, x; i <= n; i += 1) x = gi<int>(), a[x] = 1;
  limit = 1;
  while (limit <= 1e6) limit <<= 1, ++l;
  for (int i = 0; i < limit; i += 1)
    rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (l - 1));
  NTT(a, 1);
  for (int i = 0; i < limit; i += 1) a[i] = qpow(a[i], k);
  NTT(a, -1);
  for (int i = 0; i < limit; i += 1)
    if (a[i]) printf("%d ", i);
  puts("");
  return 0;
}
