#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int tt;
  cin >> tt;
  while (tt--) {
    long long int n, yy, w, k, q, ans = 0, f = 0;
    cin >> n;
    vector<long long int> v;
    while (n > 0) {
      yy = n % 10;
      n /= 10;
      if (yy * pow(10, ans)) v.push_back(yy * pow(10, ans));
      ans++;
    }
    cout << v.size() << '\n';
    for (auto i : v) cout << i << " ";
    cout << '\n';
  }
  return 0;
}
