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