#include <bits/stdc++.h>
using namespace std;
void solve() {
  vector<int> ans;
  int n;
  cin >> n;
  int p = 1;
  while (n) {
    if (n % 10) ans.push_back(n % 10 * p);
    n /= 10;
    p *= 10;
  }
  cout << ans.size() << '\n';
  for (int i : ans) cout << i << " ";
  cout << '\n';
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
}
