#include <bits/stdc++.h>
using namespace std;
void c_p_c() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
bool isPrime(long long n) {
  if (n < 2)
    return false;
  else if (n == 2)
    return true;
  if (n % 2 == 0) return false;
  for (int i = 3; i * i <= n; i += 2) {
    if (n % i == 0) return false;
  }
  return true;
}
int main() {
  c_p_c();
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int temp;
    temp = n;
    int rem, cnt = 0;
    int noOfDigits = 0;
    while (temp > 0) {
      rem = temp % 10;
      if (rem != 0) cnt++;
      temp /= 10;
      noOfDigits++;
    }
    cout << cnt << endl;
    temp = n;
    for (int i = 0; i < noOfDigits; i++) {
      if (temp % 10 != 0) {
        cout << (temp % 10) * pow(10, i) << " ";
      }
      temp /= 10;
    }
    cout << endl;
  }
  return 0;
}
