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