#include <bits/stdc++.h>
using namespace std;
set<int> bz;
int n, m, nownum;
void dfs(int deep, int x, int y) {
  if (m == 0) return;
  if (deep >= 4) {
    int nxt = abs(n - x);
    if (nxt >= 10000) return;
    int now = nownum * 10000 + nxt;
    if (bz.find(now) != bz.end()) return;
    bz.insert(now);
    m--;
    printf("%08d\n", now);
    return;
  }
  dfs(deep + 1, x * (y % 10), y / 10);
  dfs(deep + 1, x + y % 10, y / 10);
  dfs(deep + 1, abs(x - y % 10), y / 10);
  if (deep <= 2) {
    dfs(deep + 2, x * (y % 100), y / 100);
    dfs(deep + 2, x + y % 100, y / 100);
    dfs(deep + 2, abs(x - y % 100), y / 100);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i <= 9999; i++) {
    nownum = i;
    dfs(1, i % 10, i / 10);
    dfs(2, i % 100, i / 100);
  }
  return 0;
}
