#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long int num;
    cin >> num;
    vector<int> v;
    int div = 1;
    while (num > 0) {
      long int temp = num % 10;
      if (temp == 0) {
        div = div * 10;
        num = num / 10;
        continue;
      } else {
        int x = temp * div;
        v.push_back(x);
        num = num / 10;
        div = div * 10;
      }
    }
    cout << v.size() << endl;
    for (int i = 0; i < v.size(); i++) {
      cout << v[i] << endl;
    }
  }
  return 0;
}
