#include<stdio.h>
main()
{ int i,j;
	for(i=5;i>=1;i--)
		{for(j=5;j>=1;j--)
		{if(j<=i)
		printf("%d",j);
		else
		printf(" ");
		}
	for(j=2;j<=5;j++)
		{if(j<=i)
		printf("%d",j);
		else
		printf(" ");
		}	
	printf("\n");
	}
}