#include <bits/stdc++.h>
#pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3, "Ofast", "inline")
using namespace std;
const long long N = 1e6 + 7;
long long t, ma, nm, cnt = 0, edx, mi = N, sum;
long long num[N];
int main() {
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int res = 1;
    edx = 0;
    while (n > 0) {
      int y = n % 10;
      if (y != 0) {
        edx++;
        num[edx] = y * res;
      }
      res *= 10;
      n /= 10;
    }
    cout << edx << endl;
    for (int i = 1; i <= edx; i++) cout << num[i] << " ";
    cout << endl;
  }
  return 0;
}
