#B2074. Day of the Week After Exponentiated Days
Day of the Week After Exponentiated Days
Day of the Week After Exponentiated Days
Assume today is Sunday. Given two integers a and b, compute the day of the week after \(a^b\) days. The computation is based on the cycle of 7 days. For example, if \(a^b = 8\), then 8 mod 7 = 1, so the day is Monday.
The day names in order are: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday.
inputFormat
The input consists of two space-separated integers a and b where a and b can be any non-negative integers. Note that \(a^b\) might be very large, so you should use modular exponentiation.
outputFormat
Output the name of the day of the week (in English) that will occur after \(a^b\) days from Sunday.
sample
2 3
Monday