#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    if (n < 10) {
      cout << 1 << '\n' << n << '\n';
    } else {
      vector<string> vec;
      int count = 0;
      string s = to_string(n);
      for (int i = 0; i <= s.size() - 1; i++) {
        if (s[i] != '0') {
          count++;
          char newc = s[i];
          stringstream sso;
          sso << newc;
          string news;
          sso >> news;
          for (int j = i + 1; j < s.size(); j++) news += '0';
          vec.push_back(news);
        }
      }
      cout << count << '\n';
      for (int i = 0; i <= vec.size() - 1; i++) cout << vec[i] << " ";
      cout << '\n';
    }
  }
}
