# Code
x = int(input(‘Enter day number between 2 & 365 : ‘))
d = input(‘Enter first day of the year : ‘)
l = [‘Sunday’, ‘Monday’, ‘Tuesday’, ‘Wednesday’, ‘Thursday’, ‘Friday’, ‘Saturday’]
print(l[l.index(d) + x%7 – 1]) # index() finds the index of d in the list l, x%7 because days are same every 7 days