#include <bits/stdc++.h>
using namespace std;
int testCase;
int iinf = 1e9 + 1;
long long inf = 1e16 + 1;
void solve() {
  long long n;
  cin >> n;
  long long r, s = 1;
  string str = to_string(n);
  int c = 0;
  for (auto i : str) {
    if (i != '0') c++;
  }
  cout << c << "\n";
  while (n) {
    r = n % 10;
    if (r != 0) cout << s * r << " ";
    s *= 10;
    n /= 10;
  }
  cout << "\n";
}
int main() {
  cin >> testCase;
  while (testCase--) {
    solve();
  };
}
