#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T > 0) {
    T--;
    int n;
    cin >> n;
    int d = 1;
    vector<int> v;
    while (n > 0) {
      if (n % 10) v.push_back(n % 10 * d);
      n /= 10;
      d *= 10;
    }
    cout << v.size() << "\n";
    for (int i = 0; i < v.size(); i++) {
      cout << v[i] << " ";
    }
    cout << "\n";
  }
  return 0;
}
