#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 0;
  char ch = getchar();
  while (ch < '0' || '9' < ch) f |= ch == '-', ch = getchar();
  while ('0' <= ch && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return f ? -x : x;
}
int c[19], a[109];
int main() {
  int T = read();
  while (T--) {
    int s = read(), n = read(), L = 0, g = 0;
    while (s) {
      g += s % 10;
      c[L++] = s % 10;
      s /= 10;
    }
    int now = 0;
    while (g < n) {
      while (!now || !c[now]) now += 1;
      c[now]--, c[now - 1] += 10;
      now -= 1;
      g += 9;
    }
    g = 1;
    now = 0;
    for (int i = 0; i < L; i++) {
      for (int j = 0; j < c[i]; j++)
        if (now != n) {
          a[now++] = g;
        } else {
          a[n - 1] += g;
        }
      g *= 10;
    }
    for (int i = 0; i < n; i++) printf("%d%c", a[i], i == n - 1 ? '\n' : ' ');
  }
  return 0;
}
