#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target( \
    "avx,avx2,fma,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
long long MOD = 1e9 + 7;
long long k, nw;
set<long long> a;
void dfs(long long st, long long fn) {
  if (st == 0) {
    long long r = abs(k - fn);
    if (r < 1e4) {
      a.insert(nw * 10000 + r);
      a.insert(r * 10000 + nw);
    }
    return;
  }
  dfs(0, st + fn);
  dfs(0, st - fn);
  dfs(0, st * fn);
  dfs(st / 10, st % 10 + fn);
  dfs(st / 10, st % 10 - fn);
  dfs(st / 10, st % 10 * fn);
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0),
      cout << fixed << setprecision(20);
  long long m, kol = 1;
  cin >> k >> m;
  for (int i = 0; i < 1e4; i++) {
    nw = i;
    dfs(i / 10, i % 10);
  }
  for (auto i : a) {
    printf("%08d\n", i);
    if (kol == m) return 0;
    kol++;
  }
  cout << a.size();
}
