#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int m;
    cin >> m;
    int t = 0;
    vector<int> answ;
    for (int i = 0; m; ++i) {
      if (m % 10 != 0) {
        answ.push_back((m % 10) * pow(10, i));
        ++t;
      }
      m /= 10;
    }
    cout << t << endl;
    for (int i = 0; i < t; ++i) {
      cout << answ[i] << " ";
    }
    cout << endl;
  }
}
