


import math




def     __SCREAMING_SNAKE_CASE							(       )		->     None:




						'''simple docstring'''







						__UpperCAmelCase			:							Optional[int]	    =	input('''Enter message: '''      )
						__UpperCAmelCase			:							Any	    =	int(input(f"Enter key [2-{len(lowercase_      ) - 1}]: "      )      )
						__UpperCAmelCase			:							Any	    =	input('''Encryption/Decryption [e/d]: '''      )

						if mode.lower().startswith('''e'''      ):
												__UpperCAmelCase			:							Dict	    =	encrypt_message(lowercase_      ,       lowercase_      )
						elif mode.lower().startswith('''d'''      ):
												__UpperCAmelCase			:							Any	    =	decrypt_message(lowercase_      ,       lowercase_      )

						# Append pipe symbol (vertical bar) to identify spaces at the end.
						print(f"Output:\n{text + '|'}"      )




def     __SCREAMING_SNAKE_CASE							(       lowercase_      ,       lowercase_      )		->     str:




						'''simple docstring'''







						__UpperCAmelCase			:							Dict	    =	[''''''] * key
						for col in range(lowercase_      ):
												__UpperCAmelCase			:							Any	    =	col
												while pointer < len(lowercase_      ):
																		cipher_text[col] += message[pointer]
																		pointer += key
						return "".join(lowercase_      )




def     __SCREAMING_SNAKE_CASE							(       lowercase_      ,       lowercase_      )		->     str:




						'''simple docstring'''







						__UpperCAmelCase			:							Optional[Any]	    =	math.ceil(len(lowercase_      ) / key      )
						__UpperCAmelCase			:							List[str]	    =	key
						__UpperCAmelCase			:							Tuple	    =	(num_cols * num_rows) - len(lowercase_      )
						__UpperCAmelCase			:							Any	    =	[''''''] * num_cols
						__UpperCAmelCase			:							Union[str, Any]	    =	0
						__UpperCAmelCase			:							Optional[Any]	    =	0

						for symbol in message:
												plain_text[col] += symbol
												col += 1

												if (
												    (col == num_cols)
												    or (col == num_cols - 1)
												    and (row >= num_rows - num_shaded_boxes)
												):
																		__UpperCAmelCase			:							Dict	    =	0
																		row += 1

						return "".join(lowercase_      )


if __name__ == "__main__":
				import doctest

				doctest.testmod()
				main()





def     __SCREAMING_SNAKE_CASE							(       )		->     Optional[int]:




						'''simple docstring'''







						__UpperCAmelCase			:							str	    =	[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

						__UpperCAmelCase			:							Union[str, Any]	    =	6
						__UpperCAmelCase			:							Optional[Any]	    =	1
						__UpperCAmelCase			:							Tuple	    =	1901

						__UpperCAmelCase			:							Any	    =	0

						while year < 2001:
												day += 7

												if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
																		if day > days_per_month[month - 1] and month != 2:
																								month += 1
																								__UpperCAmelCase			:							Optional[int]	    =	day - days_per_month[month - 2]
																		elif day > 29 and month == 2:
																								month += 1
																								__UpperCAmelCase			:							Optional[Any]	    =	day - 29
												else:
																		if day > days_per_month[month - 1]:
																								month += 1
																								__UpperCAmelCase			:							Optional[Any]	    =	day - days_per_month[month - 2]

												if month > 12:
																		year += 1
																		__UpperCAmelCase			:							int	    =	1

												if year < 2001 and day == 1:
																		sundays += 1
						return sundays


if __name__ == "__main__":
				print(solution())

