#include <bits/stdc++.h>
using namespace std;
int k, m;
set<int> S;
int pw[10];
void rec(int ind, int number, int value) {
  if (ind == 4) {
    if (value > k && value - k < 10000) {
      S.insert(number * 10000 + (value - k));
    }
    if (k >= value && k - value < 10000) {
      S.insert(number * 10000 + (k - value));
    }
    return;
  }
  for (int i = 1; i + ind < 5; i++) {
    for (int j = 0; j < pw[i]; j++) {
      if (ind == 0) {
        rec(ind + i, j, j);
      } else {
        rec(ind + i, number * pw[i] + j, value + j);
        rec(ind + i, number * pw[i] + j, value - j);
        rec(ind + i, number * pw[i] + j, value * j);
      }
    }
  }
}
int main() {
  scanf("%d", &k);
  scanf("%d", &m);
  pw[0] = 1;
  for (int i = 1; i <= 6; i++) pw[i] = pw[i - 1] * 10;
  rec(0, 0, 0);
  for (set<int>::iterator it = S.begin(); (it != S.end()) && m; it++, m--) {
    cout << setw(8) << setfill('0') << (*it) << endl;
  }
  return 0;
}
