#include <bits/stdc++.h>
using namespace std;
int main() {
  int tt;
  cin >> tt;
  while (tt--) {
    long long n;
    cin >> n;
    string s = to_string(n);
    int c = 0;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] != '0') c++;
    }
    cout << c;
    cout << "\n";
    for (int i = 0; i < s.size(); ++i) {
      if (!(s[i] == '0')) {
        cout << s[i];
        int temp = s.size() - i - 1;
        while (temp--) cout << 0;
        cout << " ";
      }
    }
  }
}
