#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  int n;
  while (t--) {
    cin >> n;
    int temp;
    int cnt = 0;
    int sum = 0;
    int arr[5];
    int i = 0;
    if (n > 10) {
      while (n > 0) {
        temp = n % 10;
        if (temp == 0) {
          n = n / 10;
          cnt++;
          continue;
        }
        sum++;
        arr[i] = temp * pow(10, cnt);
        n = n / 10;
        cnt++;
        i++;
      }
      cout << sum << endl;
      for (int j = 0; j < i; j++) cout << arr[j] << " ";
      cout << endl;
    } else {
      cout << "1" << endl;
      cout << n << endl;
    }
  }
}
