#include <bits/stdc++.h>
using namespace std;
const int NN = 10000;
const int MM = 3000030;
int Target, Need, Current, Left;
int Flag[NN];
void Make(int n, int dig[]) {
  if (n == 1) {
    Left = Target + dig[0];
    if (Left >= 0 && Left < NN && Flag[Left] != Current) {
      Flag[Left] = Current;
      printf("%04d%04d\n", Left, Current);
      Need--;
      if (!Need) exit(0);
    }
    Left = Target - dig[0];
    if (Left >= 0 && Left < NN && Flag[Left] != Current) {
      Flag[Left] = Current;
      printf("%04d%04d\n", Left, Current);
      Need--;
      if (!Need) exit(0);
    }
  } else {
    int tmp[4];
    n--;
    for (int i = n; i--;) {
      for (int j = 0; j < i; j++) tmp[j] = dig[j];
      for (int j = i + 1; j < n; j++) tmp[j] = dig[j + 1];
      tmp[i] = dig[i] - dig[i + 1];
      Make(n, tmp);
      tmp[i] = dig[i] + dig[i + 1];
      Make(n, tmp);
      tmp[i] = dig[i] * dig[i + 1];
      Make(n, tmp);
    }
  }
}
int main() {
  memset(Flag, -1, sizeof Flag);
  cin >> Target >> Need;
  int dig[4];
  int tmp, nn;
  for (Current = 10000; Current--;) {
    tmp = Current;
    nn = 0;
    while (tmp) {
      dig[nn++] = tmp % 10;
      tmp /= 10;
    }
    while (nn < 4) dig[nn++] = 0;
    Make(4, dig);
  }
  return 0;
}
