#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
long long n, x;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    cin >> n;
    vector<long long> ans;
    long long power = 1;
    while (n > 0) {
      if (n % 10 > 0) {
        ans.push_back((n % 10) * power);
      }
      n /= 10;
      power *= 10;
    }
    cout << ans.size() << "\n";
    for (auto number : ans) cout << number << " ";
    cout << "\n";
  }
  return 0;
}
