#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-11;
const int inf = 0x3f3f3f3f;
template <class T>
void show(T a, int n) {
  for (int i = 0; i < n; ++i) cout << a[i] << ' ';
  cout << endl;
}
template <class T>
void show(T a, int r, int l) {
  for (int i = 0; i < r; ++i) show(a[i], l);
  cout << endl;
}
const int N = 1e5 + 111;
map<pair<int, int>, set<int> > q;
inline void un(set<int> &s1, set<int> &s2, set<int> &ans, int rt) {
  for (set<int>::iterator it1 = s1.begin(); it1 != s1.end(); ++it1) {
    for (set<int>::iterator it2 = s2.begin(); it2 != s2.end(); ++it2) {
      int a = *it1;
      int j;
      for (j = 0; j < rt; j++) a *= 10;
      a += *it2;
      ans.insert(a);
      if ((int)((ans).size()) >= 300000) return;
    }
    if ((int)((ans).size()) >= 300000) return;
  }
}
set<int> rec(int len, int res) {
  res = abs(res);
  if (q.count(make_pair(len, res))) {
    return q[make_pair(len, res)];
  }
  set<int> ans;
  int i, j;
  int t = 1;
  for (i = 0; i < len; i++) t *= 10;
  if (res < t) ans.insert(res);
  if (len == 1) return q[make_pair(len, res)] = ans;
  for (i = 1; i <= len - 1; i++) {
    if (i > 3) break;
    for (j = 0; j < 10; j++) {
      set<int> s1 = rec(i, j);
      if (s1.empty()) continue;
      set<int> s2 = rec(len - i, res - j);
      un(s1, s2, ans, len - i);
      if ((int)((ans).size()) >= 300000) break;
      s2 = rec(len - i, res + j);
      un(s1, s2, ans, len - i);
      if ((int)((ans).size()) >= 300000) break;
      if (j && res % j == 0) {
        s2 = rec(len - i, res / j);
        un(s1, s2, ans, len - i);
      }
      if ((int)((ans).size()) >= 300000) break;
    }
    if (ans.size() > 3e5) break;
  }
  return q[make_pair(len, res)] = ans;
}
int main() {
  int k, m;
  cin >> k >> m;
  set<int> ans = rec(8, k);
  while (m--) {
    int t = *ans.begin();
    ans.erase(ans.begin());
    string s = "";
    int j;
    for (j = 0; j < 8; j++) {
      s += (char)(t % 10 + '0');
      t /= 10;
    }
    reverse(s.begin(), s.end());
    printf("%s\n", s.c_str());
  }
  return 0;
}
