



import string

# frequency taken from https://en.wikipedia.org/wiki/Letter_frequency
A_		:     Union[str, Any]        =     {
    '''E''': 12.70,
    '''T''': 9.06,
    '''A''': 8.17,
    '''O''': 7.51,
    '''I''': 6.97,
    '''N''': 6.75,
    '''S''': 6.33,
    '''H''': 6.09,
    '''R''': 5.99,
    '''D''': 4.25,
    '''L''': 4.03,
    '''C''': 2.78,
    '''U''': 2.76,
    '''M''': 2.41,
    '''W''': 2.36,
    '''F''': 2.23,
    '''G''': 2.02,
    '''Y''': 1.97,
    '''P''': 1.93,
    '''B''': 1.29,
    '''V''': 0.98,
    '''K''': 0.77,
    '''J''': 0.15,
    '''X''': 0.15,
    '''Q''': 0.10,
    '''Z''': 0.07,
}
A_		:     Optional[Any]        =     '''ETAOINSHRDLCUMWFGYPBVKJXQZ'''
A_		:     int        =     '''ABCDEFGHIJKLMNOPQRSTUVWXYZ'''


def 	UpperCAmelCase__      (      UpperCAmelCase__ :str					):






	'''simple docstring'''

	a						=		{letter: 0 for letter in string.ascii_uppercase}
	for letter in message.upper():
		if letter in LETTERS:
			letter_count[letter] += 1

	return letter_count


def 	UpperCAmelCase__      (      UpperCAmelCase__ :tuple					):






	'''simple docstring'''

	return x[0]


def 	UpperCAmelCase__      (      UpperCAmelCase__ :str					):






	'''simple docstring'''

	a						=		get_letter_count(_UpperCamelCase					)
	a						=		{
	    freq: [] for letter, freq in letter_to_freq.items()
	}
	for letter in LETTERS:
		freq_to_letter[letter_to_freq[letter]].append(_UpperCamelCase					)

	a						=		{}

	for freq in freq_to_letter:
		freq_to_letter[freq].sort(key=ETAOIN.find ,					reverse=_UpperCamelCase					)
		a						=		"".join(freq_to_letter[freq]					)

	a						=		list(freq_to_letter_str.items()					)
	freq_pairs.sort(key=_UpperCamelCase ,					reverse=_UpperCamelCase					)

	a						=		[freq_pair[1] for freq_pair in freq_pairs]

	return "".join(_UpperCamelCase					)


def 	UpperCAmelCase__      (      UpperCAmelCase__ :str					):






	'''simple docstring'''

	a						=		get_frequency_order(_UpperCamelCase					)
	a						=		0
	for common_letter in ETAOIN[:6]:
		if common_letter in freq_order[:6]:
			match_score += 1

	for uncommon_letter in ETAOIN[-6:]:
		if uncommon_letter in freq_order[-6:]:
			match_score += 1

	return match_score


if __name__ == "__main__":
					import doctest

					doctest.testmod()






A_		:     Any        =     [4, 1, 7, 4, 2, 6, 4, 1, 5, 3, 7, 5]
A_		:     Tuple        =     [3, 7, 7, 4, 2, 6, 4, 1, 5, 3, 7, 5]
A_		:     Optional[int]        =     {
    0: '''Sunday''',
    1: '''Monday''',
    2: '''Tuesday''',
    3: '''Wednesday''',
    4: '''Thursday''',
    5: '''Friday''',
    6: '''Saturday''',
}


def 	UpperCAmelCase__      (      UpperCAmelCase__ :int ,					UpperCAmelCase__ :int ,					UpperCAmelCase__ :int					):






 '''simple docstring'''

 assert len(str(UpperCAmelCase__					)					) > 2, "year should be in YYYY format"
 assert 1 <= month <= 12, "month should be between 1 to 12"
 assert 1 <= day <= 31, "day should be between 1 to 31"

 # Doomsday algorithm:
 a						=		year // 1_00
 a						=		(5 * (century % 4) + 2) % 7
 a						=		year % 1_00
 a						=		centurian % 12
 a						=		(
     (centurian // 12) + centurian_m + (centurian_m // 4) + century_anchor
 ) % 7
 a						=		(
     DOOMSDAY_NOT_LEAP[month - 1]
     if (year % 4 != 0) or (centurian == 0 and (year % 4_00) == 0)
     else DOOMSDAY_LEAP[month - 1]
 )
 a						=		(dooms_day + day - day_anchor) % 7
 return WEEK_DAY_NAMES[week_day]


if __name__ == "__main__":
     import doctest

     doctest.testmod()

