A2362 「ROIR 2021 Day 2」日期

暂无评定 传统题 ROIR(俄罗斯) 上传者
时间限制1000ms
内存限制512MiB
通过 / 提交0/0

A2362「ROIR 2021 Day 2」日期

暂无评定 传统题 ROIR(俄罗斯) 上传者
时间限制1000ms
内存限制512MiB
通过 / 提交0/0

Description

Translated from Chinese version of ROIR 2021 Day2 T1 Календарь на Альфе Центавра on this website.

On a exterior planet, there are mm months in one year, and dd days in one month, as well as ww days in a week.

To distinguish different days of a week, humans use words like Monday and Tuesday to do that, while people on that planet use lowercase letters a…za\ldots z to represent different days in a week.

Given that Year 11, Month 11, Day 11 is represented by weekday a, your task is to find which weekday corresponds to Day ii, Month jj, Year kk.

Input Format

The input file consists of two lines.

In the first line, there are three integers, respectively d, m, wd,~m,~w and three integers i, j, ki,~j,~k in the next line, respectively.

Output Format

Output a letter representing the weekday of the given date.

30 12 7
18 1 2021
b

Constraints

For all subtasks, it is guaranteed that 1≤d,m≤1001\le d,m\le 100, 1≤w≤261\le w\le 26, 1≤i≤d1\le i\le d, 1≤j≤m1\le j\le m, 1≤k≤1091\le k\le 10^9.

Subtask # Additional Constraints Score
11 d=m=1d=m=1 1616
22 m=1m=1,k≤107k\le 10^7
33 i=j=1i=j=1 1717
44 k=1k=1
55 k≤100k\le 100
66 No additional constraints.