#include <stdio.h>
int main(){
int a,c,e,h,x,v,z;
int g = 0;
int b = 1;
int d;
int y = 1;
int f = 10;
scanf("%d",&a);// 个数
while(a >= b){
scanf("%d",&c);
if (c == 0){
printf("0");
}
else{
for (d=1;d<=c;d*=10) {
//e = c / d % f;
g+=1;
//printf("%d ",g);
}
}
h = g;
g = 0;
for (x = 1;x<h;x++){
y = y * 10;
//printf("%d ",y);
}
for (z = 1;z <= h;y /= 10){
v = c / y % f;
printf("%d ",v);
}
b+=1;
//printf("%d\n",b);
}
return 0;
}