d;i;main(m,p){gets(&p);printf("01:");for(;d++,i<365;i++){d>31-(m-2?102/m%2:3)?d=1,printf("\n%02d:",++m):0;i%7-p/7%7?:printf(" %02d",d);}}