#include <bits/stdc++.h>
int main() {
  int f(int x);
  int ans[10];
  int t, m, math, o;
  scanf("%d", &t);
  while (t--) {
    int flag = 0;
    scanf("%d", &m);
    o = 1;
    o = f(o);
    math = 0;
    for (int i = 0; m > 0; i++) {
      ans[i] = (m % 10) * o;
      if (ans[i] != 0) {
        math++;
      }
      flag++;
      o = o * 10;
      m = m / 10;
    }
    printf("%d\n", math);
    for (int i = 0; i < flag; i++) {
      if (ans[i] != 0) {
        printf("%d ", ans[i]);
      }
    }
    printf("\n");
  }
  return 0;
}
int f(int x) {
  int n;
  n = x;
  return n;
}
