Under construction

Still being built. Things may change

Year 2007

Interview

Time limit2sMemory limit128 MB

Summary
Given a month and day in 2007, compute and print the corresponding day of the week starting from Monday, Jan 1.
Level

Easy2 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

Today is Monday, January 1, 2007. Given a date in 2007, write a program that determines the day of the week for that date.

Input

The first line contains a month x and a day y, separated by a space. 1 <= x <= 12 and 1 <= y <= 31.

The number of days in each month of 2007 is as follows.

  • January, March, May, July, August, October, December: 31 days
  • April, June, September, November: 30 days
  • February: 28 days

The input date is guaranteed to be a valid date in 2007.

Output

Print the day of the week for the given date as one of SUN, MON, TUE, WED, THU, FRI, or SAT.

Examples4

  1. Example 1

    Input
    1 1
    
    Expected output
    MON
    
  2. Example 2

    Input
    3 14
    
    Expected output
    WED
    
  3. Example 3

    Input
    9 2
    
    Expected output
    SUN
    
  4. Example 4

    Input
    12 25
    
    Expected output
    TUE