#include <bits/stdc++.h>
using namespace std;
int mod = 998244353;
int root = 3;
int w[(1 << 22) + 1];
int winv[(1 << 22) + 1];
int leninv[(1 << 22) + 1];
int power(int x, int y) {
  if (y == 0) return 1;
  int a = power(x, y / 2);
  a = (1LL * a * a) % mod;
  if (y % 2) a = (1LL * a * x) % mod;
  return a;
}
void init() {
  for (int i = 0; i <= 22; i++) {
    w[(1 << i)] = power(root, (mod - 1) / (1 << i));
    winv[(1 << i)] = power(root, (mod - 1) - (mod - 1) / (1 << i));
    leninv[(1 << i)] = power((1 << i), mod - 2);
  }
}
void ntt(vector<int> &a, bool invert) {
  int n = a.size();
  for (int i = 1, j = 0; i < n; i++) {
    int bit = n >> 1;
    for (; j & bit; bit >>= 1) j ^= bit;
    j ^= bit;
    if (i < j) swap(a[i], a[j]);
  }
  for (int len = 2; len <= n; len *= 2) {
    int wlen;
    if (!invert)
      wlen = w[len];
    else
      wlen = winv[len];
    for (int i = 0; i < n; i += len) {
      int w = 1;
      for (int j = 0; j < len / 2; j++) {
        int u = a[i + j];
        int v = (1LL * w * a[i + j + len / 2]) % mod;
        a[i + j] = (u + v) % mod;
        a[i + j + len / 2] = (u + ((-v + 2 * mod) % mod)) % mod;
        w = (1LL * w * wlen) % mod;
      }
    }
  }
  if (invert) {
    int val = leninv[n];
    for (auto &it : a) it = (1LL * it * val) % mod;
  }
}
void multiply(vector<int> &a, vector<int> &b, bool rs) {
  int N = 1;
  int bsz = b.size();
  int asz = a.size() + b.size() - 1;
  while (N < (a.size() + b.size() - 1)) N *= 2;
  if (rs) {
    a.resize(N, 0);
    b.resize(N, 0);
    ntt(a, false);
    ntt(b, false);
    for (int i = 0; i < N; i++) a[i] = (1LL * a[i] * b[i]) % mod;
    ntt(a, true);
    ntt(b, true);
    b.resize(bsz);
  } else {
    a.resize(N, 0);
    ntt(a, false);
    for (int i = 0; i < N; i++) a[i] = (1LL * a[i] * a[i]) % mod;
    ntt(a, true);
  }
  a.resize(asz);
  for (auto &it : a)
    if (it) it = 1;
}
void polyPow(vector<int> &a, vector<int> &b, int x) {
  if (x == 0) return;
  polyPow(a, b, x / 2);
  multiply(a, a, false);
  if (x % 2) multiply(a, b, true);
}
int n, k;
vector<int> a, b;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  init();
  b.resize(1001, 0);
  a.push_back(1);
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    b[x] = 1;
  }
  while (!b.empty() && b.back() == 0) b.pop_back();
  polyPow(a, b, k);
  int tot = 0;
  for (int i = 0; i < a.size(); i++)
    if (a[i]) cout << i << " ";
}
