1601.Days passing

Time Limit: 1s Memory Limit: 256MB

LYX is a handsome boy in HNU who likes math very much. One day his girlfriend JY asked LYX a simple problem: “Today is Sunday, what day of week will it be after $400^{600}$ days, and what about $120^{714}$?” LYX is very smart and answered: That will be Monday and Sunday.

Now LYX summarizes this problem as follows:
'a' denote the day of week today ('a' belongs to {Mon, Tue, Wed, Thu, Fri, Sat, Sun}), what is the date after $N^M(1≤N \lt 10^{10000},6≤M \lt 10000)$ day(s) ? We guaranteed that $M$ is exactly divided by $6$.

Input Format(From the terminal/stdin)

There is $1$ line, containing $1$ string and $2$ integers. The integers are $N$ and $M$ described above, separated by a space.

Output Format(To the terminal/stdout)

Output a string s representing the date of the that day.
The string $s$ should belong to $\{Mon, Tue, Wed, Thu, Fri, Sat, Sun\}$.

Sample Input 1

Copy
Sun 2 12
   · ·  \n

Sample Output 1

Copy
Mon
   \n

Sample Input 2

Copy
Wed 7 6
   · · \n

Sample Output 2

Copy
Wed
   \n
Source: 2019 HNU新生赛

Submit

请先 登录

© 2025 FAQs