#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, i, j = 0, g, c = 0, d = 0, arr[4], x = 1;
  cin >> t;
  for (i = 0; i < t; i++) {
    c = j = d = 0;
    x = 1;
    cin >> n;
    g = n;
    for (int i = 0; g != 0; i++) {
      if (g % 10 != 0) {
        c++;
        arr[j++] = (g % 10) * x;
        g = g / 10;
      } else
        g = g / 10;
      d++;
      x = x * 10;
    }
    cout << c << endl;
    for (int i = c - 1; i >= 0; i--) {
      cout << arr[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
