#include <bits/stdc++.h>
using namespace std;
void solve(int t) {
  int n;
  cin >> n;
  int count = 0;
  int duplicate = n;
  while (n > 0) {
    count += (n % 10 != 0);
    n /= 10;
  }
  cout << count;
  cout << endl;
  count = 1;
  while (duplicate > 0) {
    if (duplicate % 10 != 0) {
      cout << count * (duplicate % 10);
      cout << " ";
    }
    count *= 10;
    duplicate /= 10;
  }
  cout << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) solve(t);
}
