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