#include <bits/stdc++.h>
using namespace std;
int cnt = 0, a[10000000 + 5], k, m;
void dfs(int now, int sum, int p) {
  if (cnt > 10000000) return;
  if (now == 4) {
    if (sum - k < 10000 && sum - k >= 0)
      a[++cnt] = p * 10000 + abs(sum - k), a[++cnt] = p + abs(sum - k) * 10000;
    if (sum + k < 10000 && sum + k >= 0)
      a[++cnt] = p * 10000 + abs(sum + k), a[++cnt] = p + abs(sum + k) * 10000;
    return;
  }
  if (now)
    for (int i = 0; i <= 9; i++) dfs(now + 1, sum * i, p * 10 + i);
  for (int i = 0; i <= 9; i++)
    dfs(now + 1, sum + i, p * 10 + i), dfs(now + 1, sum - i, p * 10 + i);
}
int main() {
  scanf("%d%d", &k, &m);
  dfs(0, 0, 0);
  sort(a + 1, a + 1 + cnt);
  cnt = unique(a + 1, a + 1 + cnt) - a - 1;
  for (int i = 1; i <= m; i++) printf("%08d\n", a[i]);
  return 0;
}
