#include <bits/stdc++.h>
using namespace std;
const int N = 10001;
const int M = 100001;
const int HA = 998244353;
const int INF = 2147483647;
const long long INFL = 9223372036854775807;
int a[101];
int main() {
  int t, n;
  scanf("%d", &t);
  while (t--) {
    int cnt = 0;
    scanf("%d", &n);
    while (n != 0) {
      a[++cnt] = n % 10;
      n /= 10;
    }
    int tot = 1, ans = 0;
    for (int i = (1); i <= (cnt); i++) {
      if (a[i] != 0) {
        ans++;
      }
    }
    printf("%d\n", ans);
    for (int i = (1); i <= (cnt); i++) {
      if (a[i] != 0) {
        printf("%d ", a[i] * tot);
      }
      tot *= 10;
    }
    puts("");
  }
  return 0;
}
