#include <bits/stdc++.h>
using namespace std;
struct Node {
  int node, len;
  Node() { node = len = 0; }
  Node(int node, int len) { this->node = node, this->len = len; }
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  for (int iii = 1; iii <= t; iii++) {
    int n;
    cin >> n;
    int pow = 1;
    int cnt = 0;
    int save = n;
    while (save) {
      if (save % 10) cnt++;
      save /= 10;
    }
    cout << cnt << '\n';
    while (n) {
      if (n % 10) cout << n % 10 * pow << ' ';
      pow *= 10;
      n /= 10;
    }
    cout << '\n';
  }
}
