#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int m = 1;
    vector<int> ans;
    while (n > 0) {
      if (n % 10) ans.push_back((n % 10) * m);
      n /= 10;
      m *= 10;
    }
    cout << ans.size() << '\n';
    for (auto i : ans) cout << i << " ";
    cout << '\n';
  }
  return 0;
}
