#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int a[1005], dp[1000005];
int main() {
  int n, m, i, j, tmp;
  while (scanf("%d%d", &n, &m) != EOF) {
    tmp = INF;
    for (i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      tmp = min(tmp, a[i]);
    }
    for (i = 1; i <= n; i++) a[i] -= tmp;
    memset(dp, INF, sizeof(dp));
    dp[0] = 0;
    for (i = 0; i <= 1000000; i++) {
      for (j = 1; j <= n; j++)
        if (i >= a[j]) dp[i] = min(dp[i], dp[i - a[j]] + 1);
    }
    for (i = 0; i <= 1000000; i++)
      if (dp[i] <= m) printf("%d ", i + tmp * m);
    printf("\n");
  }
  return 0;
}
