#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, s, i;
  cin >> n >> s;
  vector<long long> ans(s + 1, 0);
  long long need = n - s, br = 1;
  while (need > 0 || br == 1) {
    for (i = 1; i <= s; i++) {
      if (br == 1) {
        need++;
      }
      long long num = 1;
      while (num <= need) {
        num *= 10;
      }
      num /= 10;
      need -= num;
      ans[i] += num;
    }
    br = 0;
  }
  for (i = 1; i <= s; i++) {
    cout << ans[i] << " ";
  }
  cout << "\n";
}
int main() {
  long long n;
  cin >> n;
  while (n--) {
    solve();
  }
  return 0;
}
