Cossack Vus and Time Travel#10704

Cossack Vus and Time Travel

1 second
256 megabytes
Very easy

Cossack Vus invented a time machine.

He has already traveled in time to the d_1-th day of the m_1-th month of some year. It turned out to be the w_1-th day of the week.

Now Cossack Vus plans to travel in time to the d_2-th day of the m_2-th month of the same year. Help him find out what day of the week it will be.

Assume that this year is not a leap year, so:

Input

The first line contains three integers m_1, d_1 and w_1 (1 \le m_1 \le 12, 1 \le d_1 \le (\text{number of days in month }m_1), 1 \le w_1 \le 7) — the month, day, and day of the week of the first date.

The second line contains two integers m_2 and d_2 (1 \le m_2 \le 12, 1 \le d_2 \le (\text{number of days in month }m_2)) — the month and day of the second date.

Output

Print one number w_2 (1 \le w_2 \le 7) — the day of the week of the second date.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Note

In the first example, Cossack Vus first traveled to August 26 (the th day of the week, i.e., Thursday), and then to September 13. We can assume this is the year 2021 (in 2021, August 26 is indeed a Thursday). Let's check the calendar for what day of the week September 13 will be. It's Monday (the st day of the week), so the answer is .

In the second example, Cossack Vus first traveled to February 1 (Sunday), and then to January 31. This is definitely not 2021. But we know that January 31 comes before February 1. Therefore, the answer is the day of the week before Sunday, which is Saturday.