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