#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  long long k = 0;
  vector<long long> v;
  while (n) {
    long long x = n % 10;
    if (x == 0) {
      n = n / 10;
      k++;
      continue;
    }
    x = x * pow(10, k);
    v.push_back(x);
    k++;
    n /= 10;
  }
  cout << v.size() << "\n";
  for (long long i = 0; i <= v.size() - 1; i++) cout << v[i] << " ";
  cout << "\n";
  return;
}
int32_t main() {
  long long test;
  cin >> test;
  while (test--) {
    solve();
  }
  return 0;
}
