#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, i, c, r, a[5];
  cin >> t;
  while (t--) {
    cin >> n;
    c = 0;
    while (n) {
      a[c] = (n % 10) * pow(10, c);
      n /= 10;
      c++;
    }
    r = c;
    for (i = 0; i < c; i++) {
      if (a[i] == 0) r--;
    }
    cout << r << endl;
    for (i = 0; i < c; i++) {
      if (a[i] != 0) {
        cout << a[i] << " ";
      }
    }
    cout << endl;
  }
}
