#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  int k;
  int v[10];
  for (int i = 0; i < t; i++) {
    int n;
    cin >> n;
    int a = log10(n);
    k = 0;
    for (int j = a; j >= 0; j--) {
      int b = n / (pow(10, j));
      if (b == 0) {
        continue;
      }
      n -= (b * (pow(10, j)));
      v[k] = b * (pow(10, j));
      k++;
    }
    cout << k << endl;
    for (int l = 0; l < k; l++) {
      cout << v[l] << " ";
    }
    cout << endl;
  }
  return 0;
}
