#include <bits/stdc++.h>
int goal, n, a[5];
bool vis[10000];
std ::set<int> solve(int l, int r) {
  std ::set<int> s;
  if (l == r) {
    s.insert(a[l]), s.insert(-a[l]);
    return s;
  }
  for (int mid = l; mid < r; ++mid) {
    std ::set<int> s0 = solve(l, mid), s1 = solve(mid + 1, r);
    for (std ::set<int>::iterator it0 = s0.begin(); it0 != s0.end(); ++it0)
      for (std ::set<int>::iterator it1 = s1.begin(); it1 != s1.end(); ++it1) {
        int x0 = *it0, x1 = *it1;
        s.insert(x0 + x1);
        s.insert(x0 - x1);
        s.insert(x0 * x1);
      }
  }
  return s;
}
void dfs(int id) {
  if (id == 5) {
    memset(vis, 0, sizeof(vis));
    std ::set<int> s = solve(1, 4);
    int x;
    for (std ::set<int>::iterator it = s.begin(); it != s.end(); ++it)
      if ((x = std ::abs(*it - goal)) < 10000) {
        if (vis[x]) continue;
        vis[x] = true;
        for (int i = 1; i < 5; ++i) putchar('0' + a[i]);
        printf("%04d\n", x);
        if (!--n) exit(0);
      }
    return;
  }
  for (int i = 0; i < 10; ++i) a[id] = i, dfs(id + 1);
}
int main() {
  scanf("%d%d", &goal, &n);
  dfs(1);
}
