#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  long long pro = 1;
  vector<long long> v;
  while (n > 0) {
    if (n % 10 != 0) v.push_back((n % 10) * pro);
    n /= 10;
    pro *= 10;
  }
  cout << int((v).size()) << "\n";
  for (auto it = v.begin(); it != v.end(); it++) cout << (*it) << " ";
  cout << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long test;
  cin >> test;
  while (test--) {
    solve();
  }
  return 0;
}
