#include
#include
#include
#include
int main()
{
int n, x, y, z;
int a[20] = {0};
int i = 0, sum = 0;
scanf("%d %d", &n, &z); // n个人,z次
srand( (unsigned)time(NULL) );
while(z--)
{
x = rand()%4 + 2; // [2,5]
y = rand()%3 + 1;
i = (i+x)%20;
a[i] += y;
sum += y;
}
for(i = 0; i < n; ++i)
if( a[i] != 0 )
printf("%d:%d\n", i+1, a[i]);
printf("\npay:%d\n", 5*(int)ceil(sum/3));
return 0;
}