#include <bits/stdc++.h>
using namespace std;
int main() {
  int nTest;
  cin >> nTest;
  while (nTest--) {
    int n;
    cin >> n;
    int cur = 1;
    vector<int> ans;
    while (n) {
      if (n % 10) ans.push_back((n % 10) * cur);
      cur *= 10;
      n /= 10;
    }
    cout << ans.size() << endl;
    for (int u : ans) cout << u << " ";
    cout << endl;
  }
  return 0;
}
