#include <bits/stdc++.h>
using namespace std;
int m, k, dig[4], op[4], a[4], c;
char s[5];
set<int> ans;
int calc() {
  for (int i = 0; i < 4; ++i) a[i] = dig[i];
  int op[4];
  for (int i = 0; i < 4; ++i) op[i] = ::op[i];
  c = 4;
  for (int i = 1; i < c;)
    if (op[i] == 3) {
      a[i - 1] = a[i - 1] * 10 + a[i];
      for (int j = i; j + 1 < c; ++j) {
        a[j] = a[j + 1];
        op[j] = op[j + 1];
      }
      --c;
    } else
      ++i;
  for (int i = 1; i < c;)
    if (op[i] == 2) {
      a[i - 1] *= a[i];
      for (int j = i; j + 1 < c; ++j) {
        a[j] = a[j + 1];
        op[j] = op[j + 1];
      }
      --c;
    } else
      ++i;
  int res = 0;
  for (int i = 0; i < c; ++i) res += op[i] == 1 ? -a[i] : a[i];
  return res;
}
int main() {
  scanf("%d%d", &k, &m);
  int co = 0;
  for (int val = 0; val < 10000 && ans.size() < m; ++val) {
    for (op[0] = 0; op[0] < 2; ++op[0])
      for (op[1] = 0; op[1] < 4; ++op[1])
        for (op[2] = 0; op[2] < 4; ++op[2])
          for (op[3] = 0; op[3] < 4; ++op[3]) {
            int x = calc();
            if (x >= 0 && x < 10000 &&
                (((k - x) ^ ((k - x) >> 31)) - ((k - x) >> 31)) >= 0 &&
                (((k - x) ^ ((k - x) >> 31)) - ((k - x) >> 31)) < 10000)
              ans.insert(val * 10000 +
                         (((k - x) ^ ((k - x) >> 31)) - ((k - x) >> 31)));
          }
    if (val < 9999) {
      ++dig[c = 3];
      while (dig[c] == 10) {
        dig[c] = 0;
        ++dig[c - 1];
        --c;
      }
    }
  }
  c = 0;
  for (set<int>::iterator it = ans.begin(); c < m; ++it, ++c)
    printf("%.8d\n", *it);
  return 0;
}
