#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int a[N], ans[N];
void solve() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> s;
    int cnt = 0;
    while (n > 0) {
      int x = n % 10;
      n /= 10;
      if (x != 0) {
        cnt++;
      }
      s.push_back(x);
    }
    cout << cnt << endl;
    for (int i = s.size() - 1; i >= 0; i--) {
      if (s[i] != 0) {
        cout << s[i] * pow(10, i) << " ";
      }
    }
  }
}
int main() { solve(); }
