#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  int t, n, k, tmp;
  bool flag;
  vector<int> v;
  cin >> t;
  while (t--) {
    cin >> n;
    flag = false;
    v.clear();
    k = 1;
    while (n > 0) {
      if (n % 10 != 0) {
        flag = true;
        tmp = (n % 10) * k;
        v.push_back(tmp);
      }
      n = n / 10;
      k = k * 10;
    }
    cout << v.size() << endl;
    if (v.size() > 0) {
      for (int i = 0; i < v.size(); i++) {
        cout << v[i] << " ";
      }
      cout << endl;
    }
  }
  return 0;
}
