#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    vector<int> res;
    int num;
    cin >> num;
    int m = 1;
    while (num != 0) {
      int x = num % 10;
      num /= 10;
      if (x != 0) res.push_back(m * x);
      m *= 10;
    }
    cout << res.size() << endl;
    for (int i = 0; i < res.size(); i++) {
      cout << res[i] << " ";
    }
    cout << endl;
  }
}
