#include <bits/stdc++.h>
using namespace std;
int n, i, x;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> x;
    int aux = x;
    int nrr = 0;
    while (aux != 0) {
      if (aux % 10 != 0) nrr++;
      aux /= 10;
    }
    cout << nrr << "\n";
    int p = 0;
    while (x != 0) {
      p++;
      int uc = x % 10;
      int nr = 1;
      if (uc != 0) {
        for (int j = 1; j < p; j++) nr = nr * 10;
      }
      if (nr * uc != 0) cout << nr * uc << " ";
      x = x / 10;
    }
    cout << "\n";
  }
  return 0;
}
