#include <bits/stdc++.h>
using namespace std;
const int maxN = 100001;
vector<int> v[maxN], s[maxN];
set<int> c[maxN];
set<string> ans;
bool mark[maxN];
int t[maxN];
void make(int k) {
  if (mark[k]) return;
  mark[k] = 1;
  if (k < 10)
    v[k].push_back(k);
  else {
    c[k].insert(k);
    for (int i = 10; i < k; i *= 10) {
      int l = k / i;
      int r = k % i;
      make(l);
      make(r);
      for (int itl = 0; itl < v[l].size(); itl++)
        for (int itr = 0; itr < v[r].size(); itr++) {
          c[k].insert(v[l][itl] + v[r][itr]);
          c[k].insert(v[l][itl] - v[r][itr]);
          c[k].insert(v[l][itl] * v[r][itr]);
        }
    }
    for (set<int>::iterator it = c[k].begin(); it != c[k].end(); it++)
      v[k].push_back(*it);
  }
}
void work(int n) {
  for (int i = 0; i <= n; i++) {
    make(i);
    for (int j = 0; j < v[i].size(); j++)
      if (v[i][j] >= 0 && v[i][j] < maxN) {
        t[v[i][j]]++;
        s[v[i][j]].push_back(i);
      }
  }
  cerr << "Done!" << endl;
}
string toS(int k) {
  string s = "";
  while (k) {
    s += k % 10 + '0';
    k /= 10;
  }
  return s;
}
int main() {
  ios::sync_with_stdio(0);
  work(9999);
  int n, m;
  cin >> n >> m;
  for (int i = 0; ans.size() < m && i <= 10000; i++)
    for (int l = 0; ans.size() < m && l < s[i].size(); l++)
      for (int r = 0; ans.size() < m && r < s[abs(n - i)].size(); r++) {
        int a = s[i][l], b = s[abs(n - i)][r];
        string s = toS(a) + toS(b);
        while (s.size() < 8) s += '0';
        reverse(s.begin(), s.end());
        ans.insert(s);
      }
  if (ans.size() < m) cout << n / (m / (m + 1)) << endl;
  for (set<string>::iterator it = ans.begin(); it != ans.end(); it++)
    cout << *it << endl;
}
