#include <bits/stdc++.h>
#pragma GCC optimize("O3")
const double pi = acos(-1);
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const int MAXN = 10000;
const double eps = 1e-9;
using namespace std;
int n, m, cur;
set<int> s;
void dfs(int x, int y) {
  if (y == 0) {
    int tmp = abs(abs(x) - n);
    if (tmp < MAXN) {
      if (s.size() < m) s.insert(cur * MAXN + tmp);
      if (s.size() < m) s.insert(cur + MAXN * tmp);
    }
    return;
  }
  dfs(x + (y % 10), y / 10);
  dfs(x - (y % 10), y / 10);
  dfs(x * (y % 10), y / 10);
}
int main() {
  scanf("%d", &(n)), scanf("%d", &(m));
  for (int i = 0; i < MAXN; i++) {
    cur = i;
    dfs(i % 10, i / 10);
  }
  auto it = s.begin();
  for (; it != s.end(); it++) printf("%08d\n", *it);
  return 0;
}
