#include <bits/stdc++.h>
using namespace std;
int tc, n, aux, divi, cont;
vector<int> v;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> tc;
  for (int i = 1; i <= tc; i++) {
    cin >> n;
    divi = 10;
    cont = 0;
    while (n > 0) {
      cont++;
      aux = n % 10 * (divi / 10);
      n /= 10;
      divi *= 10;
      if (aux != 0)
        v.push_back(aux);
      else
        cont--;
    }
    cout << cont << "\n";
    for (auto k : v) cout << k << " ";
    cout << "\n";
    v.clear();
  }
  return 0;
}
