#include <bits/stdc++.h>
using namespace std;
void solve() {
  string n;
  cin >> n;
  vector<string> vec;
  int si = n.size();
  for (int i = 0; i < si; i++) {
    if (n[i] == '0') continue;
    string s = "";
    s += n[i];
    for (int j = i + 1; j < si; j++) {
      s += '0';
    }
    vec.push_back(s);
  }
  cout << vec.size() << "\n";
  for (int i = 0; i < int(vec.size()); i++) {
    cout << vec[i] << " ";
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
