#include <bits/stdc++.h>
using namespace std;
template <class T>
using V = vector<T>;
using Graph = vector<vector<int>>;
using P = pair<long long, long long>;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const long long INF = 1e18;
int f(int n) {
  int res = 1;
  for (int i = 0; i < n; i++) res *= 10;
  return res;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int q;
  cin >> q;
  while (q--) {
    int n;
    cin >> n;
    string s;
    s = to_string(n);
    reverse((s).begin(), (s).end());
    V<int> ans;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] - '0' != 0) {
        ans.push_back((s[i] - '0') * f(i));
      }
    }
    cout << ans.size() << endl;
    for (int a : ans) cout << a << ' ';
    cout << endl;
  }
}
