#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long ans[50];
    long long c = 0;
    long long k = 0;
    while (n > 0) {
      if (n % 10 != 0) {
        ans[c] = (n % 10) * pow(10, k);
        c++;
      }
      k++;
      n = n / 10;
    }
    cout << c << "\n";
    for (long long i = 0; i < c; i++) cout << ans[i] << " ";
    cout << "\n";
  }
}
