#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    int q = 1;
    vector<int> p;
    while (n != 0) {
      if (n % 10 != 0) p.push_back(q * (n % 10));
      q *= 10;
      n /= 10;
    }
    cout << p.size() << endl;
    for (int i = 0; i < p.size(); i++) cout << p[i] << " ";
    cout << endl;
  }
}
