cat(strptime(readLines("stdin"),"%Y%m%d")$wday,sep=" ")