#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, j, k, l, s, tot, q[100];
  while (scanf("%d %d", &n, &m) != EOF) {
    for (i = 0; i <= 9; i++)
      for (j = 0; j <= 9; j++)
        for (k = 0; k <= 9; k++)
          for (l = 0; l <= 9; l++) {
            q[0] = i - j - k - l;
            q[1] = i + j + k + l;
            q[2] = i - j + k + l;
            q[3] = i + j - k + l;
            q[4] = i + j + k - l;
            q[5] = i - j - k + l;
            q[6] = i - j + k - l;
            q[7] = i + j - k - l;
            q[8] = i * j + k + l;
            q[9] = i * j - k - l;
            q[10] = i * j - k + l;
            q[11] = i * j + k - l;
            q[12] = 10 * i + j + k + l;
            q[13] = 10 * i + j - k - l;
            q[14] = 10 * i + j - k + l;
            q[15] = 10 * i + j + k - l;
            q[16] = i + j * k + l;
            q[17] = i - j * k + l;
            q[18] = i - j * k - l;
            q[19] = i + j * k - l;
            q[20] = i + j + k * l;
            q[21] = i - j + k * l;
            q[22] = i - j - k * l;
            q[23] = i + j - k * l;
            q[24] = i + 10 * j + k + l;
            q[25] = i - (10 * j + k) + l;
            q[26] = i - (10 * j + k) - l;
            q[27] = i + 10 * j + k - l;
            q[28] = i + j + 10 * k + l;
            q[29] = i - j + 10 * k + l;
            q[30] = i - j - (10 * k + l);
            q[31] = i + j - (10 * k + l);
            q[32] = i * j + k * l;
            q[33] = i * j - k * l;
            q[34] = 10 * i + j + k * l;
            q[35] = 10 * i + j - k * l;
            q[36] = i * j + 10 * k + l;
            q[37] = i * j - (10 * k + l);
            q[38] = 10 * i + j + 10 * k + l;
            q[39] = 10 * i + j - (10 * k + l);
            q[40] = i * j * k + l;
            q[41] = i * j * k - l;
            q[42] = i + j * k * l;
            q[43] = i - j * k * l;
            q[44] = 100 * i + 10 * j + k + l;
            q[45] = 100 * i + 10 * j + k - l;
            q[46] = i + 100 * j + 10 * k + l;
            q[47] = i - (100 * j + 10 * k + l);
            q[48] = i * j * k * l;
            q[49] = 1000 * i + 100 * j + 10 * k + l;
            for (s = 0; s < 50; s++) q[s] = abs(q[s]);
            sort(q, q + 50);
            tot = unique(q, q + 50) - q;
            s = 0;
            if (m && (q[0] == 0) && (n != 10000))
              printf("%04d%d%d%d%d\n", n, i, j, k, l), m--, s++;
            if (q[0] == 0) s = 1;
            for (; s < tot; s++) {
              if (m && (n + q[s] < 10000))
                printf("%04d%d%d%d%d\n", n + q[s], i, j, k, l), m--;
              if (m && (n - q[s] >= 0))
                printf("%04d%d%d%d%d\n", n - q[s], i, j, k, l), m--;
            }
            if (m == 0) goto NextCase;
          }
  NextCase:;
  }
  return 0;
}
