#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    string s;
    vector<long long> v;
    cin >> s;
    int i, n = 1, k = 1, a = 1;
    for (i = s.size() - 1; i > 0; i--) {
      if (s[i] != '0') {
        k++;
        long long x = s[i] - 48;
        v.push_back(x * a);
      }
      a *= 10;
    }
    long long b = s[0] - 48;
    v.push_back(b * a);
    cout << k << endl;
    for (i = 0; i < v.size(); i++) {
      cout << v[i] << " ";
    }
    cout << endl;
  }
}
