#include <bits/stdc++.h>
using namespace std;
long double esp = 1e-11;
const long double PI = acos(-1.0);
const long long int INF = 0x3f3f3f3f;
const long long int MOD = 1000000007;
const int maxn = 10010;
const int NUM = 25;
long long int wn[NUM];
long long int mu(long long int a, long long int b, long long int P) {
  long long int ans = 1;
  a %= P;
  while (b) {
    if (b & 1) ans = ans * a % P;
    a = a * a % P;
    b >>= 1;
  }
  return ans;
}
void GetWn(long long int G, long long int P) {
  long long int t;
  for (int i = 0; i < NUM; i++) {
    t = 1ll << i;
    wn[i] = mu(G, (P - 1) / t, P);
  }
}
void Rader(long long int a[], int len) {
  int j = len >> 1, k;
  for (int i = 1; i < len - 1; i++) {
    if (i < j) swap(a[i], a[j]);
    k = len >> 1;
    while (j >= k) {
      j -= k;
      k >>= 1;
    }
    if (j < k) j += k;
  }
}
void NTT(long long int a[], int len, int on, long long int P) {
  Rader(a, len);
  long long int id = 0, w, u, t;
  for (int h = 2; h <= len; h <<= 1) {
    id++;
    for (int j = 0; j < len; j += h) {
      w = 1;
      for (int k = j; k < j + h / 2; k++) {
        u = a[k] % P;
        t = w * a[k + h / 2] % P;
        a[k] = (u + t) % P;
        a[k + h / 2] = (u - t + P) % P;
        w = w * wn[id] % P;
      }
    }
  }
  if (on == -1) {
    for (int i = 1; i < len / 2; i++) swap(a[i], a[len - i]);
    long long int inv = mu(len, P - 2, P);
    for (int i = 0; i < len; i++) a[i] = a[i] * inv % P;
  }
}
long long int a[1ll << 20];
int main() {
  int n, k, tem;
  scanf("%d%d", &n, &k);
  memset(a, 0, sizeof(a));
  for (int x = 1; x <= n; x++) {
    scanf("%d", &tem);
    a[tem] = 1;
  }
  long long int N = 1ll << 20, G = 3, P = 469762049ll;
  GetWn(G, P);
  NTT(a, N, 1, P);
  for (int i = 0; i < N; i++) a[i] = mu(a[i], k, P);
  NTT(a, N, -1, P);
  for (int i = 0; i < N; i++)
    if (a[i]) printf("%d ", i);
  return 0;
}
