#include <bits/stdc++.h>
using namespace std;
int k, n, xx;
set<int> S;
void dfs(int rest, int now) {
  if (S.size() >= n) return;
  if (!rest) {
    int yy = abs(k - abs(now));
    if (yy < 10000) {
      S.insert(xx * 10000 + yy);
      S.insert(yy * 10000 + xx);
    }
    return;
  }
  dfs(rest / 10, now + (rest % 10));
  dfs(rest / 10, now - (rest % 10));
  dfs(rest / 10, now * (rest % 10));
}
int main() {
  scanf("%d %d", &k, &n);
  for (int x = 0; x <= 9999; ++x) {
    xx = x;
    dfs(x / 10, x % 10);
  }
  for (set<int>::iterator it = S.begin(); it != S.end(); ++it) {
    if (n-- == 0) return 0;
    printf("%08d\n", *it);
  }
}
