#include<stdio.h>
int main(void) {
   int n, i, l, 
   scanf("%d", &n);
   while ( n ) {
      scanf("%d", a);
      A[8] = a / 10000000; b[8] = a[8];
      A[7] = ( a % 10000000 ) / 1000000;
      if ( b)
      A[6] = ( a % 1000000 ) / 100000;
      A[5] = ( a % 100000 ) / 10000;
      A[4] = ( a % 10000 ) / 1000;
      A[3] = ( a % 1000 ) / 100;
      A[2] = ( a % 100 ) / 10;
      A[1] = a % 10;

   return 0;
}