#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 2;
int arr[MAXN];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ;
  int t;
  cin >> t;
  for (int i = 0; i < int(t); i++) {
    int x;
    cin >> x;
    vector<int> num;
    int cnt = 1;
    while (x) {
      int calc = (x % 10) * cnt;
      if (calc) num.push_back(calc);
      x /= 10;
      cnt *= 10;
    }
    cout << num.size() << '\n';
    for (auto &j : num) cout << j << ' ';
    cout << '\n';
  }
  return 0;
}
