#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, c = 0;
    cin >> n;
    int r = n;
    int cnt = 0;
    while (r > 0) {
      int temp = r % 10;
      if (temp > 0) cnt++;
      r = r / 10;
      c++;
    }
    cout << cnt << endl;
    int it, ans;
    for (int i = 0; i < c; i++) {
      it = n % 10;
      ans = it * pow(10, i);
      if (ans > 0) cout << ans << " ";
      n = n / 10;
    }
    cout << endl;
  }
}
