#include <bits/stdc++.h>
using namespace std;
string toStr(int a) {
  ostringstream oss;
  oss << setfill('0') << setw(4) << a;
  return oss.str();
}
void solve(const string& s, set<int>& x) {
  x.insert(atoi(s.c_str()));
  for (unsigned i = 1; i < s.size(); ++i) {
    set<int> y, z;
    solve(s.substr(0, i), y);
    solve(s.substr(i), z);
    for (set<int>::iterator it1 = y.begin(); it1 != y.end(); ++it1) {
      for (set<int>::iterator it2 = z.begin(); it2 != z.end(); ++it2) {
        x.insert(*it1 + *it2);
        x.insert(abs(*it1 - *it2));
        x.insert(*it1 * *it2);
      }
    }
  }
}
int main() {
  int k, m;
  cin >> k >> m;
  for (int i = 0;; ++i) {
    string s = toStr(i);
    set<int> x;
    solve(s, x);
    set<string> ret;
    for (set<int>::iterator it = x.begin(); it != x.end(); ++it) {
      for (int j = 0; j < 3; ++j) {
        int a = k;
        if (j == 0) {
          a += *it;
        } else if (j == 2) {
          a -= *it;
        } else {
          if (*it == 0 || a % *it != 0) continue;
          a /= *it;
        }
        if (0 <= a && a <= 9999) ret.insert(s + toStr(a));
      }
    }
    for (set<string>::iterator it = ret.begin(); it != ret.end(); ++it) {
      cout << *it << endl;
      --m;
      if (m == 0) return 0;
    }
  }
}
