#include <bits/stdc++.h>
using namespace std;
void c_p_c() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  c_p_c();
  long long t;
  cin >> t;
  while (t--) {
    long long n = 0;
    cin >> n;
    long long c = n;
    long long i = 1;
    vector<long long> vec;
    long long count = 0;
    while (n != 0) {
      long long c = n % 10;
      if (c == 0) {
        i = i * 10;
        n = n / 10;
        continue;
      }
      vec.push_back(c * i);
      i = i * 10;
      n = n / 10;
      count++;
    }
    cout << count << endl;
    for (long long j : vec) {
      cout << j << " ";
    }
    cout << "\n";
  }
  return 0;
}
