#include <bits/stdc++.h>
using namespace std;
struct Node {
  double x, y;
  Node operator+(const Node &_) { return (Node){x + _.x, y + _.y}; }
  Node operator-(const Node &_) { return (Node){x - _.x, y - _.y}; }
  Node operator*(const Node &_) {
    return (Node){x * _.x - y * _.y, x * _.y + y * _.x};
  }
  Node operator*(const double &_) { return (Node){x * _, y * _}; }
} x1[1064004], x3[1064004], w[1064004];
int Rev[1064004], s, t;
void DFT(Node *a, int p) {
  for (int i = (0), i_end_ = (s); i < i_end_; i++)
    if (i < Rev[i]) swap(a[i], a[Rev[i]]);
  w[0] = (Node){1, 0};
  for (int i = 1, pi = 2; i < s; i <<= 1, pi <<= 1) {
    Node wn = (Node){cos((3.1415926535897932) / i),
                     sin((3.1415926535897932) / i) * p};
    for (int j = i - 2; j >= 0; j -= 2) w[j + 1] = wn * (w[j] = w[j >> 1]);
    for (int j = 0; j < s; j += pi) {
      Node *l = a + j, *r = a + j + i;
      for (int k = (0), k_end_ = (i); k < k_end_; k++) {
        Node Tmp = r[k] * w[k];
        r[k] = l[k] - Tmp;
        l[k] = l[k] + Tmp;
      }
    }
  }
  if (p == -1)
    for (int i = (0), i_end_ = (s); i < i_end_; i++) a[i].x /= s, a[i].y /= s;
}
int a[1005], n, k;
void solve(int m) {
  if (m == 1) {
    for (int i = 1; i <= n; i++) {
      x1[a[i]].x = x3[a[i]].x = 1;
      x1[a[i]].y = x3[a[i]].y = 0;
    }
    return;
  }
  solve(m / 2);
  for (s = 1, t = 0; s < 1000 * m; s <<= 1, t++)
    ;
  for (int i = (0), i_end_ = (s); i < i_end_; i++)
    Rev[i] = (Rev[i >> 1] >> 1) | ((i & 1) << t - 1);
  DFT(x1, 1);
  for (int i = 0; i < s; i++) x1[i] = x1[i] * x1[i];
  DFT(x1, -1);
  for (int i = 0; i < s; i++)
    if (x1[i].x > 0.5)
      x1[i].x = 1, x1[i].y = 0;
    else
      x1[i].x = x1[i].y = 0;
  if (m & 1) {
    DFT(x1, 1);
    DFT(x3, 1);
    for (int i = 0; i < s; i++) x1[i] = x1[i] * x3[i];
    DFT(x1, -1);
    DFT(x3, -1);
    for (int i = 0; i < s; i++)
      if (x1[i].x > 0.5)
        x1[i].x = 1, x1[i].y = 0;
      else
        x1[i].x = x1[i].y = 0;
    for (int i = 0; i < s; i++)
      if (x3[i].x > 0.5)
        x3[i].x = 1, x3[i].y = 0;
      else
        x3[i].x = x3[i].y = 0;
  }
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  solve(k);
  for (int i = 0; i < s; i++)
    if (x1[i].x > 0.5) printf("%d ", i);
  return 0;
}
