c=ord(raw_input()[2]) m=1 while m<13:s='%02d:'%m;d=1;exec"c+=1;s+=' %02d'%d*(c%7==5);d+=1;"*(31-4460848/4**m%4);print s;m+=1