#include <bits/stdc++.h>
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
using namespace std;
bool Finish_read;
template <class T>
inline void read(T &x) {
  Finish_read = 0;
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    if (ch == EOF) return;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  x *= f;
  Finish_read = 1;
}
template <class T>
inline void print(T x) {
  if (x / 10 != 0) print(x / 10);
  putchar(x % 10 + '0');
}
template <class T>
inline void writeln(T x) {
  if (x < 0) putchar('-');
  x = abs(x);
  print(x);
  putchar('\n');
}
template <class T>
inline void write(T x) {
  if (x < 0) putchar('-');
  x = abs(x);
  print(x);
}
const long long mod = 985661441;
namespace {
inline long long Pow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
inline long long Inv(const long long &x) { return Pow(x, mod - 2); }
inline long long Add(const long long &x, const long long &y) {
  long long res = x + y;
  if (res >= mod) res -= mod;
  return res;
}
inline long long Sub(const long long &x, const long long &y) {
  long long res = x - y;
  if (res < 0) res += mod;
  return res;
}
inline long long Mul(const long long &x, const long long &y) {
  long long res = x * y;
  if (res >= mod) res %= mod;
  return res;
}
inline long long Div(const long long &x, const long long &y) {
  long long res = x * Inv(y);
  if (res >= mod) res %= mod;
  return res;
}
}  // namespace
namespace Transform {
static const int fmaxn = 20, Fmaxn = (1 << fmaxn) + 1, G = 3;
int mx = 0, rev[Fmaxn], W[fmaxn][Fmaxn];
inline void DFT(int *a, int n) {
  if (mx < n) {
    for (int i = mx; i < n; ++i) {
      int len = (1 << i);
      long long w0 = Pow(G, (mod - 1) / (len << 1)), w = 1;
      for (int j = 0; j < len; ++j) W[i][j] = w, w = Mul(w, w0);
    }
    mx = n;
  }
  rev[0] = 0;
  for (int i = 1; i < (1 << n); ++i) {
    rev[i] = i & 1 ? rev[i ^ 1] | (1 << (n - 1)) : rev[i >> 1] >> 1;
    if (i < rev[i]) swap(a[i], a[rev[i]]);
  }
  for (int l = 0; l < n; ++l) {
    int len = (1 << l);
    for (int i = 0; i < (1 << n); i += (len << 1)) {
      for (int j = 0; j < len; ++j) {
        int x = a[i + j], y = Mul(a[i + j + len], W[l][j]);
        a[i + j] = Add(x, y), a[i + j + len] = Sub(x, y);
      }
    }
  }
}
inline void IDFT(int *a, int n) {
  reverse(a + 1, a + (1 << n));
  DFT(a, n);
  long long invn = Inv((1 << n));
  for (int i = 0; i < (1 << n); ++i) a[i] = Mul(a[i], invn);
}
}  // namespace Transform
int n, m, v[1005], mx, now[1048577];
int main() {
  read(n), read(m);
  for (int i = 1; i <= n; ++i) read(v[i]), mx = max(mx, v[i]);
  sort(v + 1, v + n + 1);
  n = unique(v + 1, v + n + 1) - v - 1;
  mx = m * mx;
  int lim = 0;
  while ((1 << lim) < mx) lim++;
  for (int i = 1; i <= n; ++i) now[v[i]] = 1;
  Transform::DFT(now, lim);
  for (int i = 0; i <= (1 << lim); ++i) now[i] = Pow(now[i], m);
  Transform::IDFT(now, lim);
  for (int i = 0; i <= (1 << lim); ++i)
    if (now[i]) printf("%d ", i);
  puts("");
}
