#include <bits/stdc++.h>
using namespace std;
template <class F, class S>
ostream& operator<<(ostream& o, const pair<F, S>& p) {
  return o << "(" << p.first << ", " << p.second << ")";
}
template <class C>
void O__(ostream& o, const C& c) {
  bool f = 1;
  for (const auto& x : c) {
    if (!f) o << ", ";
    f = 0;
    o << x;
  }
}
template <class T>
ostream& operator<<(ostream& o, const vector<T>& v) {
  o << "[";
  O__(o, v);
  o << "]";
  return o;
}
template <class T, class V>
ostream& operator<<(ostream& o, const map<T, V>& v) {
  o << "{";
  O__(o, v);
  o << "}";
  return o;
}
template <class T>
ostream& operator<<(ostream& o, const set<T>& v) {
  o << "{";
  O__(o, v);
  o << "}";
  return o;
}
const double PI = 3.1415926535897932384626433832795;
const double EPS = 1e-9;
const int INF = (1 << 31) - 1;
const long long LLINF = (1LL << 63) - 1;
map<pair<int, int>, set<string>> tickets;
map<int, vector<int>> values;
template <class T>
void su(std::vector<T>& a) {
  sort((a).begin(), (a).end());
  a.erase(unique((a).begin(), (a).end()), a.end());
}
int m;
int LEN = 4;
vector<string> temp;
string sss;
void gen(int l) {
  if (temp.size() == m) return;
  if (l == 0) {
    temp.push_back(sss);
    return;
  }
  for (char d = '0'; d <= '9'; ++d) {
    sss += d;
    gen(l - 1);
    sss.resize(sss.size() - 1);
  }
}
set<string> solve(pair<int, int> p) {
  int k = p.second;
  int len = p.first;
  if (tickets.count(p)) return tickets[p];
  if (len <= LEN) return {};
  set<string> res;
  for (int first = 1; first < len; ++first) {
    if (res.size() == m) break;
    int second = len - first;
    if (first < second) continue;
    assert(second <= LEN);
    for (int secondValue : values[second]) {
      const set<string>& secondStrings =
          solve(pair<int, int>(second, secondValue));
      {
        if (res.size() == m) break;
        int firstValue = k - secondValue;
        set<string> firstStrings = solve(pair<int, int>(first, firstValue));
        for (const auto& x : firstStrings)
          for (const auto& y : secondStrings) {
            if (res.size() == m)
              goto stop;
            else
              res.insert(x + y);
            if (res.size() == m)
              goto stop;
            else
              res.insert(y + x);
          }
      stop:;
      }
      {
        if (res.size() == m) break;
        int firstValue = k + secondValue;
        set<string> firstStrings = solve(pair<int, int>(first, firstValue));
        for (const auto& x : firstStrings)
          for (const auto& y : secondStrings) {
            if (res.size() == m)
              goto stop1;
            else
              res.insert(x + y);
            if (res.size() == m)
              goto stop1;
            else
              res.insert(y + x);
          }
      stop1:;
      }
      if (secondValue > 0 && k % secondValue == 0) {
        if (res.size() == m) break;
        int firstValue = k / secondValue;
        set<string> firstStrings = solve(pair<int, int>(first, firstValue));
        for (const auto& x : firstStrings)
          for (const auto& y : secondStrings) {
            if (res.size() == m)
              goto stop2;
            else
              res.insert(x + y);
            if (res.size() == m)
              goto stop2;
            else
              res.insert(y + x);
          }
      stop2:;
      }
    }
  }
  return tickets[p] = res;
}
map<string, vector<int>> dp2;
vector<int> getK(string s) {
  if (dp2.count(s)) return dp2[s];
  if (s.size() == 1) {
    int d = s[0] - '0';
    vector<int> r(1, -d);
    if (d) r.push_back(d);
    return dp2[s] = r;
  }
  vector<int> c;
  for (int i = 1; i < s.size(); ++i) {
    vector<int> a = getK(s.substr(0, i));
    vector<int> b = getK(s.substr(i, s.size() - i));
    for (int x : a)
      for (int y : b) {
        c.push_back(x + y);
        c.push_back(x - y);
        c.push_back(x * y);
      }
  }
  sort((c).begin(), (c).end());
  c.erase(unique((c).begin(), (c).end()), c.end());
  return dp2[s] = c;
}
string tttt;
void doit(int len) {
  vector<int> c = getK(tttt);
  for (int x : c) {
    values[tttt.size()].push_back(x);
    tickets[pair<int, int>(tttt.size(), x)].insert(tttt);
  }
  if (len == 0) {
    return;
  }
  for (char d = '0'; d <= '9'; ++d) {
    tttt += d;
    doit(len - 1);
    tttt.resize(tttt.size() - 1);
  }
}
int main() {
  doit(LEN);
  for (auto& el : values) {
    su(el.second);
    random_shuffle((el.second).begin(), (el.second).end());
  }
  int k;
  cin >> k >> m;
  if (k == 0) {
    gen(8);
    for (int i = 0; i < temp.size(); ++i) {
      cout << temp[i] << "\n";
    }
    return 0;
  }
  const set<string>& res = solve(pair<int, int>(8, k));
  cerr << "res.size()"
       << ": " << (res.size()) << "\n";
  ;
  for (const auto& s : res) {
    if (m == 0) break;
    --m;
    cout << s << "\n";
  }
  std::cerr << 1.0 * clock() / CLOCKS_PER_SEC << "sec.\n";
  return 0;
}
