#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  cin >> s;
  vector<string> s1;
  for (int i = 0; i < int((s).size()); i++) {
    string s2(int((s).size()) - i, '0');
    if (s[i] != '0') {
      s2[0] = s[i];
      s1.push_back(s2);
    }
  }
  cout << s1.size() << "\n";
  for (auto i : s1) {
    cout << i << " ";
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
