#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 10;
const int A = 1e3;
const int INF = (int)1e9;
int n, m;
int a[N];
int dp[N * N];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  sort(a + 1, a + n + 1);
  n = unique(a + 1, a + n + 1) - (a + 1);
  int all = a[1] * m;
  for (int i = n; i >= 1; --i) a[i] -= a[1];
  dp[0] = 0;
  for (int i = 1; i < N * N; ++i) dp[i] = INF;
  for (int i = 1; i < N * N; ++i) {
    for (int j = 1; j <= n && a[j] <= i; ++j)
      dp[i] = min(dp[i], dp[i - a[j]] + 1);
  }
  for (int i = 0; i < N * N; ++i)
    if (dp[i] <= m) cout << all + i << ' ';
  return 0;
}
