#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> ans;
    int k = 10;
    while (n > 0) {
      int temp = n % k;
      if (temp != 0) ans.push_back(temp);
      n = n - temp;
      k = k * 10;
    }
    cout << ans.size() << endl;
    for (int i = 0; i < ans.size(); i++) {
      cout << ans[i] << " ";
    }
    cout << endl;
  }
}
