#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> v;
    long long p = 1;
    while (n) {
      if (n % 10) {
        v.push_back((n % 10) * p);
      }
      n /= 10;
      p *= 10;
    }
    cout << v.size() << '\n';
    for (auto pr : v) {
      cout << pr << " ";
    }
    cout << '\n';
  }
  return 0;
}
