#include <bits/stdc++.h>
using namespace std;
void func() {
  int n;
  cin >> n;
  int num = 0, j = 1, i = 0;
  int a = n;
  while (a) {
    num = a % 10;
    if (num != 0) {
      i++;
    }
    a = a / 10;
  }
  cout << i << endl;
  a = n;
  while (a) {
    num = a % 10;
    if (num != 0) {
      i++;
      cout << num * j << " ";
    }
    a = a / 10;
    j *= 10;
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    func();
  }
  return 0;
}
