#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int oo = 1e9 + 7;
const ll mod = 1e9 + 7, maxn = 100010;
const double PI = acos(-1);
int main() {
  int tt;
  cin >> tt;
  while (tt--) {
    int n, d = 1;
    cin >> n;
    vector<int> ans;
    while (n) {
      if (n % 10) ans.push_back((n % 10) * d);
      d *= 10;
      n /= 10;
    }
    cout << ans.size() << endl;
    for (auto it : ans) cout << it << " ";
    cout << endl;
  }
  return 0;
}
