#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int i, j, k, l;
  int res = 0;
  set<int> Set;
  for (i = (0); i < (10000); ++i)
    for (j = (0); j < (8); ++j) {
      int arr[] = {i / 1000, (i / 100) % 10, (i / 10) % 10, i % 10};
      int t = i;
      int cur = 0;
      vector<int> v;
      for (k = (0); k < (4); ++k) {
        cur *= 10;
        cur += arr[k];
        t /= 10;
        if (k == 3 || (j & (1 << k)) != 0) {
          v.push_back(cur);
          cur = 0;
        }
      }
      int cnt = int((v).size());
      for (k = (0); k < (1 << (cnt + cnt)); ++k) {
        t = 0;
        for (l = (0); l < (cnt); ++l) {
          int a = (k >> (l + l)) & 3;
          if (a == 0 && l != 0) {
            t *= v[l];
          } else if (a == 1) {
            t -= v[l];
          } else {
            t += v[l];
          }
        }
        t = n - t;
        if (-10000 < t && t < 10000) Set.insert(10000 * i + abs(t));
      }
    }
  set<int>::iterator it = Set.begin();
  for (i = (0); i < (m); ++i) {
    printf("%08d\n", *it);
    ++it;
  }
  return 0;
};
