#include 
main()
{
 int N[5], P[5], D[5];
 int i,j;
 for (i=0; i<5; i++)
 {
   scanf("%d",&N[i]);
  scanf("%d",&P[i]);
  scanf("%d",&D[i]); 
 }
 printf("\n");
 i=0;
 
 int num, point, md;
 for (i=0; i<5; i++)
 {
     md = 10;
     point = P[i];
     for (j=0; j= 1)
            {
                num = num%10;
            }
     }
     N[i] = N[i] + num*md/10;
     printf("%d. %d\n",i+1,N[i]);
 }
 
 //getch();
 return 0;
}