for(i in readLines("stdin")){d=strptime(paste(i,1),"%Y%m%d") cat(month.abb[d$mon+1],d$year+1900,fill=T) write(sprintf("%3s",c(rep("",d$wday),1:diff(seq(d,,"mon",2)))),T,7,,"") cat(" ")}