#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
void solve() {
  int n, power = 0, k = 0, numbers[100];
  cin >> n;
  while (n > 0) {
    if (n % 10 != 0) {
      numbers[k] = (n % 10) * (pow(10, power));
      k++;
    }
    n /= 10;
    power++;
  }
  cout << k << endl;
  for (int i = 0; i < k; i++) {
    cout << numbers[i] << " ";
  }
  cout << endl;
}
