#include <bits/stdc++.h>
std::string s, current;
int numbers[10], resp = 0;
int t;
int pot(int base, int exp) {
  if (exp == 0) return 1;
  if (exp == 1) return base;
  return base * pot(base, exp - 1);
}
int main() {
  std::cin >> t;
  while (t) {
    std::cin >> s;
    memset(numbers, 0, sizeof(numbers));
    for (int i = 0; i < s.size(); ++i) {
      if (s[i] != '0') {
        resp++;
        numbers[i] = ((int)(s[i]) - 48) * pot(10, s.size() - i - 1);
      }
    }
    std::cout << resp << "\n";
    for (int i = 0; i < s.size(); ++i) {
      if (numbers[i] != 0) std::cout << numbers[i] << " ";
    }
    resp = 0;
    std::cout << "\n";
    --t;
  }
}
