#include <bits/stdc++.h>
using namespace std;
long long t, cn, n, nr, p10;
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    cn = n;
    nr = 0;
    p10 = 1;
    while (cn) {
      if (cn % 10) nr++;
      cn /= 10;
    }
    cout << nr << '\n';
    while (n) {
      if (n % 10) cout << n % 10 * p10 << ' ';
      n /= 10;
      p10 *= 10;
    }
    cout << '\n';
  }
  return 0;
}
