#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> vec;
  while (n > 0) {
    vec.push_back(n % 10);
    n /= 10;
  }
  vector<int> ans;
  for (int i = 0; i < vec.size(); i++) {
    if (vec[i] != 0) ans.push_back(vec[i] * pow(10, i));
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  cout << endl;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int t = 1;
  cin >> t;
  int count = 1;
loop:
  while (t--) {
    solve();
    count++;
  }
}
