AtCoder Beginner Contest 146 - Can't Wait for Holiday

Given is a string S representing the day of the week today.
S is SUN, MON, TUE, WED, THU, FRI, or SAT, for Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday, respectively.
After how many days is the next Sunday (tomorrow or later)?

-----Constraints-----
 - S is SUN, MON, TUE, WED, THU, FRI, or SAT.

-----Input-----
Input is given from Standard Input in the following format:
S

-----Output-----
Print the number of days before the next Sunday.

-----Sample Input-----
SAT

-----Sample Output-----
1

It is Saturday today, and tomorrow will be Sunday.

Difficulty: EASY

Starter code:

Solutions:
w = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - w.index(input()))


s = input()
a = ['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
print(a.index(s) + 1)


s = input()
week = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
n = week.index(s)
print(7 - n)


S = input()
T = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - T.index(S))


S = input()
X = {'SUN': 7, 'MON': 6, 'TUE': 5, 'WED': 4, 'THU': 3, 'FRI': 2, 'SAT': 1}
print(X[S])


s = input()
L = {'SUN': 7, 'MON': 6, 'TUE': 5, 'WED': 4, 'THU': 3, 'FRI': 2, 'SAT': 1}
print(L[s])


d = ['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
print(d.index(input()) + 1)


a = input()
b = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - b.index(a))


s = input()
t = 'SUN,MON,TUE,WED,THU,FRI,SAT'.split(',')
print(7 - t.index(s))


d = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'].index(input())
print(7 - d)


s = str(input())
if s == 'SUN':
	print(7)
	return ()
if s == 'MON':
	print(6)
	return ()
if s == 'TUE':
	print(5)
	return ()
if s == 'WED':
	print(4)
	return ()
if s == 'THU':
	print(3)
	return ()
if s == 'FRI':
	print(2)
	return ()
if s == 'SAT':
	print(1)
	return ()


S = input()
DAY = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
for num in range(7):
	if DAY[num] == S:
		print(7 - num)


s = input()
L = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - L.index(s))


S = input()
day = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
for i in range(7):
	if day[i] == S:
		print(7 - i)


S = input()
day_of_the_week = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
for i in range(len(day_of_the_week)):
	if S == day_of_the_week[i]:
		answer = 7 - i
print(answer)


x = input()
arr = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - arr.index(x))


import sys

def resolve(in_):
	S = next(in_).strip()
	_weekday = {0: 'SUN', 1: 'MON', 2: 'TUE', 3: 'WED', 4: 'THU', 5: 'FRI', 6: 'SAT'}
	weekday = {v: 7 - k for (k, v) in list(_weekday.items())}
	return weekday[S]

def main():
	answer = resolve(sys.stdin)
	print(answer)

def __starting_point():
	main()
__starting_point()


A = {'SUN': 7, 'MON': 6, 'TUE': 5, 'WED': 4, 'THU': 3, 'FRI': 2, 'SAT': 1}
print(A[input()])


d = {'SUN': 1, 'MON': 2, 'TUE': 3, 'WED': 4, 'THU': 5, 'FRI': 6, 'SAT': 7}
print(8 - d[input()])


s = input()
print(['', 'SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN'].index(s))


w = dict(SUN=7, MON=6, TUE=5, WED=4, THU=3, FRI=2, SAT=1)
print(w[input()])


l = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
a = l.index(str(input()))
print(7 - a)


D = ['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
S = input()
for (i, d) in enumerate(D):
	if d == S:
		print(i + 1)
		return ()


days = 'SUN MON TUE WED THU FRI SAT'.split()
print(7 - days.index(input()))


print('SAFRTHWETUMOSU'.find(input()[:2]) // 2 + 1)


m = ['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
print(m.index(input()) + 1)


T = ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN']
S = input()
print(6 - T.index(S) if S != 'SUN' else 7)


s = input()
l = [0, 'SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
print(l.index(s))


print(7 - 'SUNMONTUEWEDTHUFRISAT'.index(input()) // 3)


S = input()
l = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
for i in range(len(l)):
	if S == l[i]:
		print(7 - i)
		break


print({'SU': 7, 'MO': 6, 'TU': 5, 'WE': 4, 'TH': 3, 'FR': 2, 'SA': 1}[input()[:2]])


li = ['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
x = input()
print(li.index(x) + 1)


N_List = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - N_List.index(str(input())))


W = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - W.index(input()))


W = [0, 'SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
print(W.index(input()))


l = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
S = input()
r = 7 - l.index(S)
print(r)


import sys
sys.setrecursionlimit(10 ** 8)
ini = lambda : int(sys.stdin.readline())
inl = lambda : [int(x) for x in sys.stdin.readline().split()]
ins = lambda : sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print('\x1b[33m', *a, '\x1b[0m', **dict(file=sys.stderr, **kw))
d = {'SAT': 1, 'FRI': 2, 'THU': 3, 'WED': 4, 'TUE': 5, 'MON': 6, 'SUN': 7}

def solve():
	S = ins()
	return d[S]
print(solve())


s = input()
arr = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
for i in range(7):
	if s == arr[i]:
		print(7 - i)


week = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
s = input()
for (i, day) in enumerate(week):
	if day == s:
		res = 7 - i
		break
res = 7 - i
print(res)


S = input()
print(['', 'SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN'].index(S))


D = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - D.index(input()))


week = 'MON,TUE,WED,THU,FRI,SAT,SUN'.split(',')
S = input()
print(7) if S == 'SUN' else print(6 - week.index(S))


A = ['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
print(A.index(input()) + 1)


S = input()
A = ['a', 'SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
print(A.index(S))


lis = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - lis.index(input()))


l = [None, 'SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
print(l.index(input()))


from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float('inf')
(YES, Yes, yes, NO, No, no) = ('YES', 'Yes', 'yes', 'NO', 'No', 'no')
(dy4, dx4) = ([0, 1, 0, -1], [1, 0, -1, 0])
(dy8, dx8) = ([0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1])

def inside(y, x, H, W):
	return 0 <= y < H and 0 <= x < W

def ceil(a, b):
	return (a + b - 1) // b

def sum_of_arithmetic_progression(s, d, n):
	return n * (2 * s + (n - 1) * d) // 2

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	g = gcd(a, b)
	return a / g * b

def solve():
	S = input()
	i = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'].index(S)
	print(7 - i)

def main():
	solve()

def __starting_point():
	main()
__starting_point()


s = input()
x = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
y = x.index(s)
print(7 - y)


S = str(input())
if S == 'SUN':
	print(int(7 - 0))
elif S == 'MON':
	print(int(7 - 1))
elif S == 'TUE':
	print(int(7 - 2))
elif S == 'WED':
	print(int(7 - 3))
elif S == 'THU':
	print(int(7 - 4))
elif S == 'FRI':
	print(int(7 - 5))
elif S == 'SAT':
	print(int(7 - 6))


S = input()
if S == 'SUN':
	print(7)
elif S == 'MON':
	print(6)
elif S == 'TUE':
	print(5)
elif S == 'WED':
	print(4)
elif S == 'THU':
	print(3)
elif S == 'FRI':
	print(2)
else:
	print(1)


print(['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN'].index(input()) % 7 + 1)


A = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - A.index(input()))


a = input()
if a == 'SUN':
	print('7')
elif a == 'MON':
	print('6')
elif a == 'TUE':
	print('5')
elif a == 'WED':
	print('4')
elif a == 'THU':
	print('3')
elif a == 'FRI':
	print('2')
elif a == 'SAT':
	print('1')


list = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
s = input()
i = list.index(s)
answer = 7 - i
print(answer)


print('SATFRITHUWEDTUEMONSUN'.index(input()) // 3 + 1)


li = ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN']
n = input()
if n == 'SUN':
	print(7)
else:
	print(6 - li.index(n))


week = ['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
day = input()
print(week.index(day) + 1)


def resolve():
	week = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
	s = input()
	print(7 - week.index(s))
resolve()


S = input()
w = ['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
print(w.index(S) + 1)


print(['SU', 'SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN'].index(input()))


DAY = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - DAY.index(input()))


import math
from collections import Counter
from itertools import product
ii = lambda : int(input())
mi = lambda : map(int, input().split())
li = lambda : list(map(int, input().split()))
a = input()
day = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
for i in range(len(day)):
	if day[i] == a:
		print(7 - i)


print('_ SA FR TH WE TU MO SU'.split().index(input()[:2]))


day = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - day.index(input()))


S = input()
days = ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN']
cnt = days.index('SUN') - days.index(S)
if cnt == 0:
	print(7)
else:
	print(cnt)


week = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
s = input()
ans = 7 - week.index(s)
ans = ans if ans != 0 else 7
print(ans)


s = input()
wk = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
a = wk.index(s)
print(7 - a)


print('SATFRITHUWEDTUEMONSUN'.find(input()) // 3 + 1)


p = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - p.index(input()))


print('  SAFRTHWETUMOSU'.find(input()[:2]) // 2)


S = input()
ls = [0, 'SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
print(ls.index(S))


import sys
stdin = sys.stdin
ip = lambda : int(sp())
lp = lambda : list(map(int, stdin.readline().split()))
sp = lambda : stdin.readline().rstrip()
s = sp()
if s == 'SUN':
	print(7)
elif s == 'MON':
	print(6)
elif s == 'TUE':
	print(5)
elif s == 'WED':
	print(4)
elif s == 'THU':
	print(3)
elif s == 'FRI':
	print(2)
else:
	print(1)


(SUN, MON, TUE, WED, THU, FRI, SAT) = (0, 1, 2, 3, 4, 5, 6)
print(7 - eval(input()))


l = ['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
print(l.index(input()) + 1)


n = str(input())
dic = {'SUN': 7, 'MON': 6, 'TUE': 5, 'WED': 4, 'THU': 3, 'FRI': 2, 'SAT': 1}
print(dic[str(n)])


print(sum(map(ord, input() + '\n')) ** 698 % 6329 % 8)


S = input()
lst = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
dct = {}
for (i, j) in enumerate(lst):
	dct[j] = i
print(7 - dct[S])


print((sum(map(ord, input())) + 9) ** 49 % 9133 % 8)


lst = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - lst.index(input()))


wd = 'SUN MON TUE WED THU FRI SAT'.split()
wd = list(reversed(wd))

def solve(S: str):
	idx = wd.index(S)
	return idx + 1

def main():
	S = input().strip()
	answer = solve(S)
	print(answer)

def __starting_point():
	main()
__starting_point()


s = input()
res = 0
if s == 'SUN':
	res = 7
elif s == 'MON':
	res = 6
elif s == 'TUE':
	res = 5
elif s == 'WED':
	res = 4
elif s == 'THU':
	res = 3
elif s == 'FRI':
	res = 2
elif s == 'SAT':
	res = 1
print(res)


s = input()
lst = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
if s == 'SUN':
	print(7)
	return ()
for i in range(7):
	if s == lst[i]:
		print(7 - i)
		return ()


s = input()
if 'SU' in s:
	print('7')
if 'MO' in s:
	print('6')
if 'TU' in s:
	print('5')
if 'WE' in s:
	print('4')
if 'TH' in s:
	print('3')
if 'FR' in s:
	print('2')
if 'SA' in s:
	print('1')


wee = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - wee.index(input()))


S = str(input())
st = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - st.index(S))


N = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - N.index(input()))