Days passing
题号:NC200037
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
64bit IO Format: %lld

题目描述

LYX is the most 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: It will be Monday and Monday.
Now LYX abstracts this problem as follows:
'a' denote the day of week today('a' belong to {Mon, Tue, Wed, Thu,  Fri, Sat, Sun}), what is the date after N^M(1<=N<10^10000,6<=M<10000) days ? Where M is exactly divided by 6.

输入描述:

There is 1 line, 1 string, 2 integers,
there are a, N and M, separated by a space.

输出描述:

Output a string(Mon, Tue, Wed, Thu,  Fri, Sat, Sun), the day of the week.
示例1

输入

复制
Sun 2 12

输出

复制
Mon

说明

The day(Sunday) after 212(4,096) days will be  Monday.
示例2

输入

复制
Wed 7 6

输出

复制
Wed

说明

The day(Wednesday) after 76(117,649) days will be Wednesday.
示例3

输入

复制
Thu 1 6

输出

复制
Fri

说明

The day(Thursday) after 16(1) days will be Friday.