#include<stdio.h>
int main(void){
   char s[50];
   int a[100], i, j;
   while ( scanf("%s", s) != EOF ) {
      for ( i = 0; i < 10; i++ ) {
         for (j = 0; j < 10; j++ ){
            printf("%s %d\n", s, j);
            if ( s[i] == 'j') a[i] = j;
         }
         printf("%d ", a[i]);
      }
      printf("\n");
      for ( i = 10; i < 19; i++ ) { a[i] = ( a[i - 10] + a[i - 9] ) % 10; printf("%d ", a[i]); } printf("\n"); 
      for ( i = 19; i < 27; i++ ) { a[i] = ( a[i - 9] + a[i - 8] ) % 10; printf("%d ", a[i]); } printf("\n");
      for ( i = 27; i < 34; i++ ) { a[i] = ( a[i - 8] + a[i - 7] ) % 10; printf("%d ", a[i]); } printf("\n");
      for ( i = 34; i < 40; i++ ) { a[i] = ( a[i - 7] + a[i - 6] ) % 10; printf("%d ", a[i]); } printf("\n");
      for ( i = 40; i < 45; i++ ) { a[i] = ( a[i - 6] + a[i - 5] ) % 10; printf("%d ", a[i]); } printf("\n");
      for ( i = 45; i < 49; i++ ) { a[i] = ( a[i - 5] + a[i - 4] ) % 10; printf("%d ", a[i]); } printf("\n");
      for ( i = 49; i < 52; i++ ) { a[i] = ( a[i - 4] + a[i - 3] ) % 10; printf("%d ", a[i]); } printf("\n");
      for ( i = 52; i < 54; i++ ) { a[i] = ( a[i - 3] + a[i - 2] ) % 10; printf("%d ", a[i]); } printf("\n");
      for ( i = 54; i = 54; i++ ) { a[i] = ( a[i - 2] + a[i - 1])  % 10; printf("%d ", a[i]); } printf("\n");
   }
   return 0;
}