#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}
long long min(long long a, long long b) {
  if (a < b) {
    return a;
  } else {
    return b;
  }
}
string int2str(int& i) {
  string s;
  stringstream ss(s);
  ss << i;
  return ss.str();
}
int cnt;
bool done[100000000];
void outputspec(int x) {
  if (!done[x]) {
    done[x] = 1;
    string u = int2str(x);
    while (u.length() < 8) {
      u = '0' + u;
    }
    cout << u << endl;
    cnt--;
  }
}
struct node {
  int dir;
  node* next;
};
node *h[20001], *ba[20001];
void insert(int data, int tar) {
  node* temp = new node;
  temp->next = NULL;
  temp->dir = data;
  ba[tar]->next = temp;
  ba[tar] = temp;
}
void trygen(int cur, int id, int act, int yes) {
  if (id == 0) {
    if ((cur <= 10000) && (cur >= -10000)) {
      insert(act, cur + 10000);
    }
  } else {
    for (long long i = 0; i <= 9; i++) {
      int cur2 = cur + i, id2 = id / 10, act2 = act + id * i;
      trygen(cur2, id2, act2, 0);
      cur2 = cur - i;
      id2 = id / 10;
      act2 = act + id * i;
      trygen(cur2, id2, act2, 0);
      if (yes) {
        cur2 = cur * 10 + i;
        id2 = id / 10;
        act2 = act + id * i;
        trygen(cur2, id2, act2, 1);
      }
      if (id != 1000) {
        cur2 = cur * i;
        id2 = id / 10;
        act2 = act + id * i;
        trygen(cur2, id2, act2, 0);
      }
    }
  }
}
int main() {
  int k, m;
  cin >> k >> m;
  for (long long i = 0; i <= 99999999; i++) {
    done[i] = 0;
  }
  if (k == 0) {
    for (long long i = 1; i <= m; i++) {
      outputspec(i);
    }
    return 0;
  }
  if (k != 0) {
    for (long long i = 0; i <= 20000; i++) {
      h[i] = new node;
      h[i]->next = NULL;
      ba[i] = h[i];
    }
    trygen(0, 1000, 0, 1);
    cnt = m;
    for (long long j = 1; j <= 9999; j++) {
      node* a = h[j + 10000];
      if (cnt == 0) {
        return 0;
      } else {
        while (a->next != NULL) {
          a = a->next;
          node* b = h[k + 10000 - j];
          while (b->next != NULL) {
            b = b->next;
            outputspec(a->dir * 10000 + b->dir);
            if (cnt == 0) {
              return 0;
            }
          }
          b = h[-1 * k + j + 10000];
          while (b->next != NULL) {
            b = b->next;
            outputspec(a->dir * 10000 + b->dir);
            if (cnt == 0) {
              return 0;
            }
          }
        }
      }
    }
  }
  return 0;
}
