#include <bits/stdc++.h>
using namespace std;
void readi(int &x) {
  int v = 0, f = 1;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-')
    f = -1;
  else
    v = v * 10 + c - '0';
  while (isdigit(c = getchar())) v = v * 10 + c - '0';
  x = v * f;
}
void readll(long long &x) {
  long long v = 0ll, f = 1ll;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-')
    f = -1;
  else
    v = v * 10 + c - '0';
  while (isdigit(c = getchar())) v = v * 10 + c - '0';
  x = v * f;
}
void readc(char &x) {
  char c;
  while ((c = getchar()) == ' ')
    ;
  x = c;
}
void writes(string s) { puts(s.c_str()); }
void writeln() { writes(""); }
void writei(int x) {
  if (!x) putchar('0');
  char a[25];
  int top = 0;
  while (x) {
    a[++top] = (x % 10) + '0';
    x /= 10;
  }
  while (top) {
    putchar(a[top]);
    top--;
  }
}
void writell(long long x) {
  if (!x) putchar('0');
  char a[25];
  int top = 0;
  while (x) {
    a[++top] = (x % 10) + '0';
    x /= 10;
  }
  while (top) {
    putchar(a[top]);
    top--;
  }
}
int n, m, i, j;
set<string> s;
void get(int x) {
  int i, y = 0, d = 1, mem = x;
  set<int> can, c1;
  for (i = 1; i <= 4; i++) {
    c1.clear();
    int t = x % 10;
    x /= 10;
    for (set<int>::iterator it = can.begin(); it != can.end(); it++) {
      c1.insert((*it) + t);
      c1.insert((*it) - t);
      c1.insert((*it) * t);
    }
    y += d * t;
    c1.insert(y);
    can = c1;
    d *= 10;
  }
  for (set<int>::iterator it = can.begin(); it != can.end(); it++) {
    if (abs((*it) - n) > 9999) continue;
    string e;
    char t[27];
    sprintf(t, "%04d%04d", mem, abs((*it) - n));
    s.insert((e = t));
    sprintf(t, "%04d%04d", abs((*it) - n), mem);
    s.insert((e = t));
  }
}
int main() {
  cin >> n >> m;
  for (i = 1; s.size() < m; i++) get(i);
  i = 1;
  for (set<string>::iterator it = s.begin(); it != s.end() && i <= m;
       it++, i++) {
    string s = *it;
    while (s.size() < 8) s += "0";
    writes(s);
  }
  return 0;
}
