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