#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> ans;
    int p = 1;
    while (n >= 1) {
      if (n % 10 != 0) {
        int e = (n % 10) * p;
        ans.push_back(e);
      }
      n /= 10;
      p *= 10;
    }
    int cnt = ans.size();
    cout << cnt << endl;
    for (int i = cnt - 1; i >= 0; i--) {
      cout << ans[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
