#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    vector<int> v;
    int n;
    cin >> n;
    int cnt = 0;
    int cc = 1;
    while (n > 0) {
      int ans = n % 10;
      while (ans == 0) {
        n = n / 10;
        cc = cc * 10;
        ans = n % 10;
      }
      ans = ans * cc;
      v.push_back(ans);
      n = n / 10;
      cc = cc * 10;
      cnt++;
    }
    cout << cnt << endl;
    for (auto i : v) {
      cout << i << " ";
    }
    cout << endl;
  }
}
