#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void inp(T &any) {
  cin >> any;
}
template <typename T, typename... U>
inline void inp(T &a, U &...b) {
  cin >> a;
  inp(b...);
}
template <typename T>
inline istream &operator>>(istream &in, vector<T> &a) {
  for (auto &x : a) in >> x;
  return in;
}
template <typename T, typename U>
inline istream &operator>>(istream &in, pair<T, U> &a) {
  in >> a.first >> a.second;
  return in;
}
void solve(long long int &T) {
  string s;
  std::cin >> s;
  long long int n = s.size();
  vector<string> sol;
  for (long long int i = (0); i < (n); i++) {
    if (s[i] != '0') {
      string x;
      x.push_back(s[i]);
      for (long long int j = (i + 1); j < (n); j++) {
        x.push_back('0');
      }
      sol.push_back(x);
    }
  }
  std::cout << sol.size() << "\n";
  for (auto &X : sol) std::cout << X << " ";
  std::cout << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int t = 1;
  cin >> t;
  for (long long int Case = (1); Case < (t + 1); Case++) {
    11;
    solve(Case);
  }
  return 0;
}
