#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
void solve() {
  int n;
  cin >> n;
  int pw = 1;
  vector<int> v;
  while (n) {
    if (n % 10) v.emplace_back((n % 10) * pw);
    n /= 10;
    pw *= 10;
  }
  cout << (int)v.size() << "\n";
  for (auto i : v) cout << i << " ";
  cout << "\n";
}
int32_t main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  int t = 1;
  cin >> t;
  for (__typeof(t) i = (0) - ((0) > (t)); i != (t) - ((0) > (t));
       i += 1 - 2 * ((0) > (t))) {
    solve();
  }
  return 0;
}
