#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> v;
    int power = 0;
    while (n != 0) {
      int d = n % 10;
      n = n / 10;
      if (d != 0) {
        v.push_back(d * pow(10, power));
      }
      power++;
    }
    cout << v.size() << "\n";
    for (int j = 0; j < v.size(); j++) {
      cout << v[j];
      if (j != v.size() - 1) cout << " ";
    }
    cout << "\n";
  }
}
