#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int n1 = n;
    long long int c = 0;
    for (int i = 0; n1 > 0; i++) {
      if (n1 % 10 != 0) c++;
      n1 = n1 / 10;
    }
    cout << c << endl;
    long long int count = 0;
    while (n > 0) {
      if (n % 10 != 0) {
        cout << n % 10 * pow(10, count) << " ";
      }
      count++;
      n = n / 10;
    }
    cout << endl;
  }
}
