#include <bits/stdc++.h>
using namespace std;
namespace ntt {
const int P = 23;
const int MAX = (1 << P) + 1;
const int GEN = 3;
const int MOD = 998244353;
int N;
int w[MAX];
int exp(int a, int b) {
  if (b == 0) return 1;
  if (b % 2 == 1) return 1LL * a * exp(a, b - 1) % MOD;
  int sq = exp(a, b / 2);
  return 1LL * sq * sq % MOD;
}
void NTT(int a[], int x[], int k, int v) {
  w[0] = 1;
  int G = exp(GEN, (MOD - 1) / k);
  for (int i = 1; i <= k; i++) w[i] = 1LL * w[i - 1] * G % MOD;
  for (int i = 0, j = 0; i < k; i++) {
    if (i > j) swap(x[i], x[j]);
    for (int l = k >> 1; (j ^= l) < l; l >>= 1)
      ;
  }
  for (int i = 2; i <= k; i <<= 1) {
    int mid = i >> 1;
    for (int j = 0; j < k; j += i) {
      for (int l = 0; l < mid; l++) {
        int t;
        if (v == 0)
          t = 1LL * x[j + l + mid] * w[(k / i) * l] % MOD;
        else
          t = 1LL * x[j + l + mid] * w[k - (k / i) * l] % MOD;
        x[j + l + mid] = (x[j + l] - t + MOD) % MOD;
        x[j + l] += t;
        x[j + l] %= MOD;
      }
    }
  }
  if (v == 1) {
    int r = exp(N, MOD - 2);
    for (int i = 0; i < N; i++) a[i] = 1LL * a[i] * r % MOD;
  }
}
void multiply(int la, int a[], int lb, int b[]) {
  N = 1;
  int lim = 2 * max(la, lb);
  while (N < lim) N *= 2;
  for (int i = la; i < N; i++) a[i] = 0;
  for (int i = lb; i < N; i++) b[i] = 0;
  NTT(a, a, N, 0);
  NTT(a, b, N, 0);
  for (int i = 0; i < N; i++) a[i] = 1LL * a[i] * b[i] % MOD;
  NTT(a, a, N, 1);
  for (int i = 0; i < N; i++)
    if (a[i] > 1) a[i] = 1;
}
}  // namespace ntt
int n, k, mx = 1e6;
int x[ntt::MAX], y[ntt::MAX], z[ntt::MAX];
int exp(int k) {
  if (k == 0) {
    y[0] = 1;
    return 1;
  }
  if (k & 1) {
    int r = exp(k - 1);
    for (int i = 0; i <= mx; i++) z[i] = x[i];
    ntt::multiply(r, y, 1001, z);
    return 1001 + r;
  }
  int r = exp(k / 2);
  for (int i = 0; i <= mx; i++) z[i] = y[i];
  ntt::multiply(r, y, r, z);
  return r + r;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) {
    int v;
    scanf("%d", &v);
    x[v] = 1;
  }
  exp(k);
  vector<int> ans;
  for (int i = 0; i <= mx; i++)
    if (y[i] > 0) ans.push_back(i);
  for (int i = 0; i < (int)ans.size(); i++) {
    printf("%d", ans[i]);
    if (i == (int)ans.size() - 1)
      printf("\n");
    else
      printf(" ");
  }
  return 0;
}
