#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, p, count, r, t;
  cin >> t;
  while (t--) {
    vector<int> v;
    cin >> n;
    count = 1;
    while (n != 0) {
      r = n % 10;
      if (r > 0) {
        k = r * count;
        v.push_back(k);
      }
      n = n / 10;
      count *= 10;
    }
    p = v.size();
    cout << p << endl;
    for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
    cout << endl;
  }
  return 0;
}
