#include <bits/stdc++.h>
using namespace std;
const long long int INF = (long long int)1e9 + 10;
const long long int INFLL = (long long int)1e18 + 10;
const long double EPS = 1e-8;
const long double EPSLD = 1e-18;
const long long int MOD = 1e9 + 7;
template <class T>
T &chmin(T &a, const T &b) {
  return a = min(a, b);
}
template <class T>
T &chmax(T &a, const T &b) {
  return a = max(a, b);
}
long long int k, m;
long long int ss[72];
long long int pro;
vector<long long int> ans;
void dfs(long long int p, long long int cur) {
  if (p == 4) {
    cur = abs(cur);
    long long int pa = abs(cur - k);
    if (pa < 10000) {
      ans.emplace_back(pro * 10000 + pa);
      ans.emplace_back(pa * 10000 + pro);
    }
  } else {
    dfs(p + 1, ss[p] + cur);
    dfs(p + 1, ss[p] - cur);
    dfs(p + 1, ss[p] * cur);
  }
}
int main() {
  scanf("%lld %lld", &k, &m);
  for (long long int i = (0); i < (long long int)(10000); i++) {
    long long int cur = i;
    for (long long int j = (0); j < (long long int)(4); j++)
      ss[j] = cur % 10, cur /= 10;
    pro = i;
    dfs(1, ss[0]);
  }
  sort((ans).begin(), (ans).end());
  (ans).erase(unique(((ans)).begin(), ((ans)).end()), (ans).end());
  ans.resize(m);
  for (auto &w : ans) printf("%08lld\n", w);
  return 0;
}
