Calendar  Module

The calendar module allows you to output calendars and provides additional useful functions for them.

class calendar.TextCalendar([firstweekday])

This class can be used to generate plain text calendars.

Sample Code

>>> import calendar
>>> 
>>> print calendar.TextCalendar(firstweekday=6).formatyear(2015)
                                  2015

      January                   February                   March
Su Mo Tu We Th Fr Sa      Su Mo Tu We Th Fr Sa      Su Mo Tu We Th Fr Sa
             1  2  3       1  2  3  4  5  6  7       1  2  3  4  5  6  7
 4  5  6  7  8  9 10       8  9 10 11 12 13 14       8  9 10 11 12 13 14
11 12 13 14 15 16 17      15 16 17 18 19 20 21      15 16 17 18 19 20 21
18 19 20 21 22 23 24      22 23 24 25 26 27 28      22 23 24 25 26 27 28
25 26 27 28 29 30 31                                29 30 31

       April                      May                       June
Su Mo Tu We Th Fr Sa      Su Mo Tu We Th Fr Sa      Su Mo Tu We Th Fr Sa
          1  2  3  4                      1  2          1  2  3  4  5  6
 5  6  7  8  9 10 11       3  4  5  6  7  8  9       7  8  9 10 11 12 13
12 13 14 15 16 17 18      10 11 12 13 14 15 16      14 15 16 17 18 19 20
19 20 21 22 23 24 25      17 18 19 20 21 22 23      21 22 23 24 25 26 27
26 27 28 29 30            24 25 26 27 28 29 30      28 29 30
                          31

        July                     August                  September
Su Mo Tu We Th Fr Sa      Su Mo Tu We Th Fr Sa      Su Mo Tu We Th Fr Sa
          1  2  3  4                         1             1  2  3  4  5
 5  6  7  8  9 10 11       2  3  4  5  6  7  8       6  7  8  9 10 11 12
12 13 14 15 16 17 18       9 10 11 12 13 14 15      13 14 15 16 17 18 19
19 20 21 22 23 24 25      16 17 18 19 20 21 22      20 21 22 23 24 25 26
26 27 28 29 30 31         23 24 25 26 27 28 29      27 28 29 30
                          30 31

      October                   November                  December
Su Mo Tu We Th Fr Sa      Su Mo Tu We Th Fr Sa      Su Mo Tu We Th Fr Sa
             1  2  3       1  2  3  4  5  6  7             1  2  3  4  5
 4  5  6  7  8  9 10       8  9 10 11 12 13 14       6  7  8  9 10 11 12
11 12 13 14 15 16 17      15 16 17 18 19 20 21      13 14 15 16 17 18 19
18 19 20 21 22 23 24      22 23 24 25 26 27 28      20 21 22 23 24 25 26
25 26 27 28 29 30 31      29 30                     27 28 29 30 31

To learn more about different calendar functions, click here.

Task

You are given a date. Your task is to find what the day is on that date.

Input Format

A single line of input containing the space separated month, day and year, respectively, in $\textit{MM}$ $\textbf{DD}$ $YYYY$ format.

Constraints

$2000<year<3000$

Output Format

Output the correct day in capital letters. 

Sample Input
08 05 2015

Sample Output
WEDNESDAY

Explanation

The day on August $5$^{th} $2015$ was WEDNESDAY.

Difficulty: EASY

Starter code:

Solutions:
import calendar
inp = list(map(int, input().split()))
print(calendar.day_name[calendar.weekday(inp[2], inp[0], inp[1])].upper())


import calendar
a = list(map(int, input().split(' ')))
b = calendar.weekday(a[2], a[0], a[1])
if b == 0:
	print('MONDAY')
if b == 1:
	print('TUESDAY')
if b == 2:
	print('WEDNESDAY')
if b == 3:
	print('THURSDAY')
if b == 4:
	print('FRIDAY')
if b == 5:
	print('SATURDAY')
if b == 6:
	print('SUNDAY')


import calendar
items = list(map(int, input().strip().split()))
print(str.upper(calendar.day_name[calendar.weekday(items[2], items[0], items[1])]))


from calendar import *
import re

def lz(wss):
	return int(re.sub('^0', '', wss))
(mm, dd, yyyy) = input().split()
hs = {}
hs[0] = 'MONDAY'
hs[1] = 'TUESDAY'
hs[2] = 'WEDNESDAY'
hs[3] = 'THURSDAY'
hs[4] = 'FRIDAY'
hs[5] = 'SATURDAY'
hs[6] = 'SUNDAY'
print(hs[weekday(int(yyyy), lz(mm), lz(dd))])


dt = input()
WEEK = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY']
import time

def str2secs(straw):
	str2seconds = time.mktime(time.strptime(straw, '%m %d %Y'))
	return str2seconds
secs = str2secs(dt)
wk_id = time.localtime(secs).tm_wday
print(WEEK[wk_id])


import calendar
day = {0: 'MONDAY', 1: 'TUESDAY', 2: 'WEDNESDAY', 3: 'THURSDAY', 4: 'FRIDAY', 5: 'SATURDAY', 6: 'SUNDAY'}
(m, d, y) = map(int, input().split())
print(day[calendar.weekday(y, m, d)])


import calendar
a = input()
b = a.split()
m = int(b[0])
d = int(b[1])
y = int(b[2])
print(list(calendar.day_name)[calendar.weekday(y, m, d)].upper())


from calendar import weekday as wd
import sys
rl = lambda : sys.stdin.readline()
(m, d, y) = map(int, rl().split())
weekdays = {0: 'MONDAY', 1: 'TUESDAY', 2: 'WEDNESDAY', 3: 'THURSDAY', 4: 'FRIDAY', 5: 'SATURDAY', 6: 'SUNDAY'}
print(weekdays[wd(y, m, d)])


import datetime
__author__ = 'namii'
(MM, DD, YYYY) = map(int, input().split())
print(datetime.date(YYYY, MM, DD).strftime('%A').upper())


from datetime import *
(d, m, y) = map(int, input().split())
l = date(y, d, m)
print(l.strftime('%A').upper())


(m, d, y) = list(map(int, input().split()))
import calendar
wd = calendar.weekday(y, m, d)
week = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY']
print(week[wd])


import calendar
(m, d, y) = map(int, input().split())
day = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY']
print(day[calendar.weekday(y, m, d)])


import calendar
(m, d, y) = map(int, input().split())
week_names = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY']
print(week_names[calendar.weekday(y, m, d)])


import calendar
d = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY']
(month, day, year) = list(map(int, input().split(' ')))
print(d[calendar.weekday(year, month, day)])


import calendar, re
dat = input()
date = re.compile('(\\d\\d) (\\d\\d) (\\d\\d\\d\\d)')
givendate = date.search(dat)
year = givendate.group(3)
month = givendate.group(1)
day = givendate.group(2)
weekdays = {0: 'MONDAY', 1: 'TUESDAY', 2: 'WEDNESDAY', 3: 'THURSDAY', 4: 'FRIDAY', 5: 'SATURDAY', 6: 'SUNDAY'}
print(weekdays.get(calendar.weekday(int(year), int(month), int(day))))


import calendar
date = input().split()
num_day = calendar.weekday(int(date[2]), int(date[0]), int(date[1]))
print(calendar.day_name[num_day].upper())


from calendar import weekday
days = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY']
(month, day, year) = map(int, input().split())
print(days[weekday(year, month, day)])


import calendar
data = list(map(int, input().split()))
week = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
print(week[(calendar.weekday(data[2], data[0], data[1]) + 1) % 7].upper())


import calendar
(month, day, year) = map(int, input().split())
weekdays = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY']
print(weekdays[calendar.weekday(year, month, day)])


from datetime import date
(m, d, y) = map(int, input().split())
k = date(y, m, d)
print(k.strftime('%A').upper())


import datetime
d = [int(x) for x in input().split()]
d = datetime.date(d[2], d[0], d[1])
print(d.strftime('%A').upper())


import calendar
(mm, dd, yyyy) = map(int, input().split())
print(list(calendar.day_name)[calendar.weekday(yyyy, mm, dd)].upper())


import calendar
(M, D, Y) = map(int, input().split())
wday = calendar.weekday(Y, M, D)
wdays = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY', 'SUNDAY']
print(wdays[wday])


from calendar import weekday, day_name
(m, d, y) = map(int, input().strip().split())
print(day_name[weekday(y, m, d)].upper())


__author__ = 'Albert'
import calendar
data = list(map(int, input().split()))
c = calendar.TextCalendar(firstweekday=6).formatyear(data[2])
months = {1: 'January', 2: 'February', 3: 'March', 4: 'April', 5: 'May', 6: 'June', 7: 'July', 8: 'August', 9: 'September', 10: 'October', 11: 'November', 12: 'December'}
week = {0: 'MONDAY', 1: 'TUESDAY', 2: 'WEDNESDAY', 3: 'THURSDAY', 4: 'FRIDAY', 5: 'SATURDAY', 6: 'SUNDAY'}
print(week[calendar.weekday(data[2], data[0], data[1])])


from calendar import *
(m, d, y) = input().split()
z = weekday(int(y), int(m), int(d))
l = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY']
print(l[z])


import calendar
(m, d, y) = map(int, input().split())
print(calendar.day_name[calendar.weekday(y, m, d)].upper())


from datetime import date
(month, day, year) = [int(i) for i in input().split(' ')]
print(date(year, month, day).strftime('%A').upper())


import datetime
(M, D, Y) = map(int, input().split())
print(datetime.date(Y, M, D).strftime('%A').upper())


import calendar
day = input().split()
day = [int(x) for x in day]
print(calendar.day_name[calendar.weekday(day[2], day[0], day[1])].upper())


import calendar
(M, D, Y) = map(int, input().split())
index = int(calendar.weekday(Y, M, D))
if index == 0:
	print('MONDAY')
elif index == 1:
	print('TUESDAY')
elif index == 2:
	print('WEDNESDAY')
elif index == 3:
	print('THURSDAY')
elif index == 4:
	print('FRIDAY')
elif index == 5:
	print('SATURDAY')
else:
	print('SUNDAY')


import calendar
(M, D, Y) = [int(i) for i in input().split()]
print(calendar.day_name[calendar.weekday(Y, M, D)].upper())


import calendar
(MM, DD, YYYY) = map(int, input().split())
weekday = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY']
print(weekday[calendar.weekday(YYYY, MM, DD)])


import calendar
date = [int(x) for x in input().split()]
dictWeekday = {0: 'MONDAY', 1: 'TUESDAY', 2: 'WEDNESDAY', 3: 'THURSDAY', 4: 'FRIDAY', 5: 'SATURDAY', 6: 'SUNDAY'}
dayIndex = calendar.weekday(date[2], date[0], date[1])
print(dictWeekday[dayIndex])


import calendar
(m, d, y) = map(int, input().split())
v = calendar.weekday(y, m, d)
if v == 0:
	print('MONDAY')
elif v == 1:
	print('TUESDAY')
elif v == 2:
	print('WEDNESDAY')
elif v == 3:
	print('THURSDAY')
elif v == 4:
	print('FRIDAY')
elif v == 5:
	print('SATURDAY')
else:
	print('SUNDAY')


from datetime import date
import time
s = list(map(int, input().split()))
my_birthday = date(s[2], s[0], s[1])
ss = my_birthday.strftime('%A')
print(ss.upper())


import calendar
(m, d, y) = map(int, input().split())
res = calendar.weekday(int(y), int(m), int(d))
if res == 0:
	print('MONDAY')
elif res == 1:
	print('TUESDAY')
elif res == 2:
	print('WEDNESDAY')
elif res == 3:
	print('THURSDAY')
elif res == 4:
	print('FRIDAY')
elif res == 5:
	print('SATURDAY')
elif res == 6:
	print('SUNDAY')


import calendar
line = str(input()).split()
print(calendar.day_name[calendar.weekday(int(line[2]), int(line[0]), int(line[1]))].upper())


import datetime
dt = input()
(month, day, year) = (int(x) for x in dt.split(' '))
ans = datetime.date(year, month, day)
print(ans.strftime('%A').upper())


import calendar
input_date = input().split(' ')
year = int(input_date[2])
month = int(input_date[0])
date = int(input_date[1])
weekday = calendar.weekday(year, month, date)
print(calendar.day_name[weekday].upper())


import calendar
calendar.setfirstweekday(6)
(m, d, y) = [int(x) for x in input().split()]
print(calendar.day_name[calendar.weekday(y, m, d)].upper())


import calendar
(MM, DD, YY) = map(int, input().split())
print(calendar.day_name[calendar.weekday(YY, MM, DD)].upper())


import calendar
inp = input().split()
print(calendar.day_name[calendar.weekday(int(inp[2]), int(inp[0]), int(inp[1]))].upper())


import calendar
t = tuple(map(int, input().split()))
print(calendar.day_name[calendar.weekday(t[2], t[0], t[1])].upper())


import calendar
s = list(map(int, input().split()))
dayZ = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY']
print(dayZ[calendar.weekday(s[2], s[0], s[1])])


import calendar
a = [int(x) for x in input().split()]
print(list(calendar.day_name)[calendar.weekday(a[2], a[0], a[1])].upper())


import datetime
n = datetime.datetime.strptime(input(), '%m %d %Y').weekday()

def foo(nn):
	(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY) = range(7)
	for name in dict(locals()):
		if name != 'nn' and locals()[name] == nn:
			return name
print(foo(n))


import calendar
I = [int(x) for x in input().split()]
print(calendar.day_name[calendar.weekday(I[2], I[0], I[1])].upper())


from datetime import datetime
print(datetime.strptime(input(), '%m %d %Y').strftime('%A').upper())


import calendar
(a, b, c) = list(map(int, input().split()))
d = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY']
i = calendar.weekday(c, a, b)
print(d[i])


import calendar
[M, D, Y] = [int(x) for x in input().split()]
day = calendar.weekday(Y, M, D)
weekdays = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY']
print(weekdays[day])


import calendar

def to_int(d):
	if d[0] == '0':
		return int(d[1])
	return int(d)
(m, d, y) = input().split()
cal = calendar.weekday(int(y), to_int(m), to_int(d))
print(calendar.day_name[cal].upper())


import datetime
days = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY']
(m, d, y) = [int(x) for x in input().split(' ')]
da = datetime.date(y, m, d)
print(days[da.weekday()])


import calendar
(m, d, y) = map(int, input().split())
if calendar.weekday(y, m, d) == 0:
	print('MONDAY')
elif calendar.weekday(y, m, d) == 1:
	print('TUESDAY')
elif calendar.weekday(y, m, d) == 2:
	print('WEDNESDAY')
elif calendar.weekday(y, m, d) == 3:
	print('THURSDAY')
elif calendar.weekday(y, m, d) == 4:
	print('FRIDAY')
elif calendar.weekday(y, m, d) == 5:
	print('SATURDAY')
elif calendar.weekday(y, m, d) == 6:
	print('SUNDAY')


import calendar
(m, d, y) = map(int, input().split())
weekday = calendar.weekday(y, m, d)
print(calendar.day_name[weekday].upper())


import calendar
(month, day, year) = map(int, input().split())
print(calendar.day_name[calendar.weekday(year, month, day)].upper())


from calendar import weekday, day_name
(month, day, year) = map(int, input().split())
print(day_name[weekday(year, month, day)].upper())


import calendar
str = input().split(' ')
print(calendar.day_name[calendar.weekday(int(str[2]), int(str[0]), int(str[1]))].upper())


import datetime
import calendar
(m, d, y) = list(map(int, input().split()))
input_date = datetime.date(y, m, d)
print(calendar.day_name[input_date.weekday()].upper())


import calendar
(m, d, y) = map(int, input().split())
Day = calendar.weekday(y, m, d)
print(list(calendar.day_name)[Day].upper())


from datetime import date
(mm, dd, yyyy) = map(int, input().split())
d = date(yyyy, mm, dd)
print(d.strftime('%A').upper())


import calendar
A = list(map(int, input().split()))
calendar.TextCalendar(firstweekday=6).formatyear(A[2])
B = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY']
print(B[calendar.weekday(A[2], A[0], A[1])])


def filler(_y, m, d):
	m += 1
	if m < 4:
		_y -= 1
		m += 12
	y = _y // 100
	z = _y % 100
	return (5 * y + z + y // 4 + z // 4 + 13 * m // 5 + d - 1) % 7
(M, D, Y) = map(int, input().split())
print(['SUNDAY', 'MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY'][filler(Y, M, D)])


import calendar
(month, day, year) = map(int, input().split(' '))
wd = calendar.weekday(year, month, day)
if wd == 0:
	print('MONDAY')
elif wd == 1:
	print('Tuesday')
elif wd == 2:
	print('WEDNESDAY')
elif wd == 3:
	print('THURSDAY')
elif wd == 4:
	print('FRIDAY')
elif wd == 5:
	print('SATURDAY')
elif wd == 6:
	print('SUNDAY')


from calendar import day_name, weekday
(m, d, y) = map(int, input().split())
x = weekday(y, m, d)
print(day_name[x].upper())


import calendar
s = input().split()
month = int(s[0])
day = int(s[1])
year = int(s[2])
weekday = calendar.weekday(year, month, day)
print(calendar.day_name[weekday].upper())


import calendar
date = list(map(int, input().split()))
d = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY']
print(d[calendar.weekday(date[2], date[0], date[1])])


import sys
import datetime
for line in sys.stdin:
	(month, day, year) = [int(e) for e in line.strip().split(' ')]
	l = {0: 'MONDAY', 1: 'TUESDAY', 2: 'WEDNESDAY', 3: 'THURSDAY', 4: 'FRIDAY', 5: 'SATURDAY', 6: 'SUNDAY'}
	print(l[datetime.datetime(year, month, day).weekday()])


import calendar
(month, day, year) = [int(x) for x in input().split()]
print(calendar.day_name[calendar.weekday(year, month, day)].upper())


import calendar
date = list(map(int, input().split()))
print(calendar.day_name[calendar.weekday(date[2], date[0], date[1])].upper())


import calendar
(MM, DD, YYYY) = map(int, input().split())
weekday = calendar.weekday(YYYY, MM, DD)
if weekday == 0:
	print('Monday'.upper())
elif weekday == 1:
	print('Tuesday'.upper())
elif weekday == 2:
	print('Wednesday'.upper())
elif weekday == 3:
	print('Thursday'.upper())
elif weekday == 4:
	print('Friday'.upper())
elif weekday == 5:
	print('Saturday'.upper())
elif weekday == 6:
	print('Sunday'.upper())
else:
	print('ERROR'.upper())


import calendar
t = list(map(int, input().split()))
print(calendar.day_name[calendar.weekday(t[2], t[0], t[1])].upper())


import calendar
(month, day, year) = list(map(int, input().split()))
n = calendar.weekday(year, month, day)
if n == 6:
	print('SUNDAY')
if n == 0:
	print('MONDAY')
if n == 1:
	print('TUESDAY')
if n == 2:
	print('WEDNESDAY')
if n == 3:
	print('THURSDAY')
if n == 4:
	print('FRIDAY')
if n == 5:
	print('SATURDAY')


import datetime, calendar
(m, d, y) = map(int, input().split())
d = datetime.datetime(y, m, d)
print(calendar.day_name[d.weekday()].upper())


import calendar
date = input()
(m, d, y) = date.split(' ')
print(list(calendar.day_name)[calendar.weekday(int(y), int(m), int(d))].upper())


import calendar
(m, d, y) = map(int, input().split())
print(list(calendar.day_name)[calendar.weekday(y, m, d)].upper())


import calendar
str = input()
x = []
x = str.split(' ')
x = list(map(int, x))
s = calendar.weekday(x[2], x[0], x[1])
print(calendar.day_name[s].upper())


import calendar
(month, day, year) = map(int, input().split())
day_num = calendar.weekday(year, month, day)
print(calendar.day_name[day_num].upper())


import calendar
(mm, dd, yyyy) = list(map(int, input().split()))
print(list(calendar.day_name)[calendar.weekday(yyyy, mm, dd)].upper())


import calendar
(m, d, y) = map(int, input().split())
days = {0: 'MONDAY', 1: 'TUESDAY', 2: 'WEDNESDAY', 3: 'THURSDAY', 4: 'FRIDAY', 5: 'SATURDAY', 6: 'SUNDAY'}
print(days[calendar.weekday(y, m, d)])


from datetime import date
(month, day, year) = map(int, input().strip().split())
d = date(year, month, day)
print(d.strftime('%A').upper())


import calendar
date = list(map(int, input().split()))
day = date[1]
month = date[0]
year = date[2]
weekday = calendar.weekday(year, month, day)
weekday_dict = {0: 'MONDAY', 1: 'TUESDAY', 2: 'WEDNESDAY', 3: 'THURSDAY', 4: 'FRIDAY', 5: 'SATURDAY', 6: 'SUNDAY'}
print(weekday_dict[weekday])


import calendar
(month, day, year) = (int(x) for x in input().split())
print(calendar.day_name[calendar.weekday(year, month, day)].upper())


import calendar

def read_int():
	return int(input())

def read_int_words():
	return map(int, input().split())
(m, d, y) = read_int_words()
wkdi = calendar.weekday(y, m, d)
wkd = dict([(0, 'MONDAY'), (1, 'TUESDAY'), (2, 'WEDNESDAY'), (3, 'THURSDAY'), (4, 'FRIDAY'), (5, 'SATURDAY'), (6, 'SUNDAY')])
print(wkd[wkdi])


import calendar
(m, d, y) = input().split()
print(calendar.day_name[calendar.weekday(int(y), int(m), int(d))].upper())


import calendar
(month, day, year) = list(map(int, input().split()))
days = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY']
print(days[calendar.weekday(year, month, day)])


import calendar

def __starting_point():
	date = list(map(int, input().strip().split(' ')))
	print(calendar.day_name[calendar.weekday(date[2], date[0], date[1])].upper())
__starting_point()


import calendar
Date = str(input()).split()
Number = calendar.weekday(int(Date[2]), int(Date[0]), int(Date[1]))
print(str(calendar.day_name[Number].upper()))


import calendar
data = list(map(int, input().split()))
week_day = calendar.weekday(data[-1], data[0], data[1])
print(calendar.day_name[week_day].upper())


from calendar import weekday
day = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY']
(m, d, y) = map(int, input().split())
print(day[weekday(y, m, d)])


import calendar
a = [int(i) for i in input().split(' ')]
b = calendar.weekday(a[2], a[0], a[1])
b = (b + 1) % 7
if b == 0:
	print('SUNDAY')
elif b == 1:
	print('MONDAY')
elif b == 2:
	print('TUESDAY')
elif b == 3:
	print('WEDNESDAY')
elif b == 4:
	print('THURSDAY')
elif b == 5:
	print('FRIDAY')
else:
	print('SATURDAY')


import calendar
calendar.setfirstweekday(calendar.SUNDAY)
val = list(map(int, input().split()))
m = val[0]
d = val[1]
y = val[2]
re = calendar.weekday(y, m, d)
if re == 0:
	print('MONDAY')
elif re == 1:
	print('TUESDAY')
elif re == 2:
	print('WEDNESDAY')
elif re == 3:
	print('THURSDAY')
elif re == 4:
	print('FRIDAY')
elif re == 5:
	print('SATURDAY')
else:
	print('SUNDAY')


from calendar import weekday, day_name
(mounth, day, year) = [int(x) for x in input().split()]
print(day_name[weekday(year, mounth, day)].upper())


import calendar
(d, m, y) = [int(i) for i in input().strip().split()]
print(calendar.day_name[calendar.weekday(y, d, m)].upper())