{"trustable":true,"prependHtml":"\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eOn a planet far away from Earth, one year is composed of 12 months, and each month always consists of 30 days.\u003c/p\u003e\n\n\u003cp\u003eAlso on that planet, there are 5 days in a week, which are Monday, Tuesday, Wednesday, Thursday and Friday. That is to say, if today is Monday, then tomorrow will be Tuesday, the day after tomorrow will be Wednesday. After 3 days it will be Thursday, after 4 days it will be Friday, and after 5 days it will again be Monday.\u003c/p\u003e\n\n\u003cp\u003eToday is the $d_1$-th day in the $m_1$-th month of year $y_1$. Given the day of today on that planet, what day will it be (or was it) on the $d_2$-th day in the $m_2$-th month of year $y_2$ on that planet?\u003c/p\u003e\n\n\u003ch4\u003eInput\u003c/h4\u003e\n\u003cp\u003eThere are multiple test cases. The first line of the input contains an integer $T$ (about 100), indicating the number of test cases. For each test case:\u003c/p\u003e\n\n\u003cp\u003eThe first line contains three integers $y_1$, $m_1$, $d_1$ ($2000 \\le y_1 \\le 10^9$, $1 \\le m_1 \\le 12$, $1 \\le d_1 \\le 30$) and a string $s$, indicating the date and day of today on that planet. It\u0027s guaranteed that $s$ is either \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\" or \"Friday\".\u003c/p\u003e\n\n\u003cp\u003eThe second line contains three integers $y_2$, $m_2$ and $d_2$ ($2000 \\le y_2 \\le 10^9$, $1 \\le m_2 \\le 12$, $1 \\le d_2 \\le 30$), indicating the date whose day we want to know.\u003c/p\u003e\n\n\u003ch4\u003eOutput\u003c/h4\u003e\n\u003cp\u003eFor each test case output one line containing one string, indicating the day of the $d_2$-th day in the $m_2$-th month of year $y_2$ on that planet.\u003c/p\u003e\n\n\u003ch4\u003eSample\u003c/h4\u003e\n\u003ctable class\u003d\"vjudge_sample\"\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4\n2019 5 12 Monday\n2019 5 14\n2019 5 12 Tuesday\n2019 12 30\n2019 5 12 Friday\n1000000000 1 1\n1000000000 1 1 Wednesday\n2019 5 12\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eWednesday\nFriday\nThursday\nThursday\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n"}}]}