#include <bits/stdc++.h>
using namespace std;
long long const mod = 998244353;
long long const mod1 = 1000000007;
long long toint(const string &s) {
  stringstream ss;
  ss << s;
  long long x;
  ss >> x;
  return x;
}
string tostring(long long number) {
  stringstream ss;
  ss << number;
  return ss.str();
}
long long modexp(long long x, long long n) {
  if (n == 0) {
    return 1;
  } else if (n & 1) {
    return (modexp((x * x) % mod, n / 2) % mod * x % mod) % mod;
  } else {
    return (modexp((x * x) % mod, n / 2) % mod);
  }
}
long long modinv(long long n) { return modexp(n, mod - 2); }
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    string n;
    cin >> n;
    long long c = 0;
    vector<long long> v;
    long long s = n.length();
    for (long long i = 0; i < n.length(); i++) {
      if (n[i] != '0') {
        v.push_back((n[i] - '0') * pow(10, s - i - 1));
      }
    }
    cout << v.size() << endl;
    for (auto x : v) cout << x << " ";
    cout << endl;
  }
}
