#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, d;
  cin >> n;
  if (n < 10) {
    cout << 1 << endl << n << endl;
    return;
  }
  d = floor(log10(n)) + 1;
  vector<int> f;
  while (d--) {
    int a = floor(n / pow(10, d)) * (int)pow(10, d);
    n -= a;
    if (a > 0) f.push_back(a);
  }
  cout << f.size() << endl;
  for (auto a : f) cout << a << " ";
  cout << endl;
}
int t = 1;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> t;
  while (t--) solve();
  return 0;
}
