#include <bits/stdc++.h>
using namespace std;
template <typename T>
void dekhao(T val) {
  cout << "template val   is  == " << val << endl;
}
template <typename F, typename S>
ostream &operator<<(ostream &os, const pair<F, S> &p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  typename vector<T>::const_iterator it;
  for (it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ", ";
    os << *it;
  }
  return os << "}";
}
template <typename T>
ostream &operator<<(ostream &os, const set<T> &v) {
  os << "[";
  typename set<T>::const_iterator it;
  for (it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ", ";
    os << *it;
  }
  return os << "]";
}
template <typename F, typename S>
ostream &operator<<(ostream &os, const map<F, S> &v) {
  os << "[";
  typename map<F, S>::const_iterator it;
  for (it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ", ";
    os << it->first << " = " << it->second;
  }
  return os << "]";
}
int Tcase;
vector<long long int> fun(long long int n) {
  long long int num = n, cnt = 0, dos = 1;
  vector<long long int> vec;
  while (num != 0) {
    long long int r = num % 10;
    num /= 10;
    if (r) vec.push_back(dos * r);
    cnt++;
    dos = dos * 10;
  }
  return vec;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> Tcase;
  while (Tcase--) {
    long long int n;
    cin >> n;
    vector<long long int> res = fun(n);
    cout << res.size() << endl;
    for (int i = 0; i < res.size(); i++) cout << res[i] << ' ';
    cout << endl;
  }
}
