#include <bits/stdc++.h>
int t, n, i, j, ans;
using namespace std;
int main() {
  scanf("%d", &t);
  while (t--) {
    vector<int> a;
    ans = 0;
    scanf("%d", &n);
    int cnt = -1;
    while (n > 0) {
      cnt++;
      j = n % 10;
      if (j != 0) {
        ans = j;
        for (i = 0; i < cnt; i++) {
          ans = ans * 10;
        }
        a.push_back(ans);
      }
      n = n / 10;
    }
    printf("%d\n", a.size());
    for (int i = 0; i < a.size(); i++)
      if (i == 0)
        printf("%d", a[i]);
      else
        printf(" %d", a[i]);
    printf("\n");
  }
  return 0;
}
