from collections import Counter
from timeit import timeit
def       A	(    _lowercase = ""		,  ):
						return sum(c % 2 for c in Counter(input_str.replace(''' '''		,  ''''''						).lower()						).values()						) < 2
def       A	(    _lowercase = ""						):
						if len(_lowercase						) == 0:
												return True
						SCREAMING_SNAKE_CASE							:    Tuple							=							input_str.replace(''' '''		,  ''''''						).lower()
						# character_freq_dict: Stores the frequency of every character in the input string
						SCREAMING_SNAKE_CASE							:    dict[str, int]							=							{}

						for character in lower_case_input_str:
												SCREAMING_SNAKE_CASE							:    Optional[int]							=							character_freq_dict.get(_lowercase		,  0						) + 1
						SCREAMING_SNAKE_CASE							:    Tuple							=							0

						for character_count in character_freq_dict.values():
												if character_count % 2:
																		odd_char += 1
						if odd_char > 1:
												return False
						return True
def       A	(    _lowercase = ""						):
						print('''\nFor string = '''		,  _lowercase		,  ''':'''						)
						print(
						    '''> can_string_be_rearranged_as_palindrome_counter()'''		,  '''\tans ='''		,  can_string_be_rearranged_as_palindrome_counter(_lowercase						)		,  '''\ttime ='''		,  timeit(
						        '''z.can_string_be_rearranged_as_palindrome_counter(z.check_str)'''		,  setup='''import __main__ as z'''		,  )		,  '''seconds'''		,  )
						print(
						    '''> can_string_be_rearranged_as_palindrome()'''		,  '''\tans ='''		,  can_string_be_rearranged_as_palindrome(_lowercase						)		,  '''\ttime ='''		,  timeit(
						        '''z.can_string_be_rearranged_as_palindrome(z.check_str)'''		,  setup='''import __main__ as z'''		,  )		,  '''seconds'''		,  )


if __name__ == "__main__":
					__UpperCamelCase		:       List[str]									=     input(
					    'Enter string to determine if it can be rearranged as a palindrome or not: '
					).strip()
					benchmark(check_str)
					__UpperCamelCase		:       Optional[int]									=     can_string_be_rearranged_as_palindrome_counter(check_str)
					print(f"""{check_str} can {'' if status else 'not '}be rearranged as a palindrome""")






import itertools
import string
from collections.abc import Generator, Iterable
def       A	(    _lowercase		,  _lowercase						):
						SCREAMING_SNAKE_CASE							:    Union[str, Any]							=							iter(_lowercase						)
						while True:
												SCREAMING_SNAKE_CASE							:    Optional[Any]							=							tuple(itertools.islice(_lowercase		,  _lowercase						)						)
												if not chunk:
																		return
												yield chunk
def       A	(    _lowercase						):
						SCREAMING_SNAKE_CASE							:    int							=							''''''.join([c.upper() for c in dirty if c in string.ascii_letters]						)
						SCREAMING_SNAKE_CASE							:    List[str]							=							''''''

						if len(_lowercase						) < 2:
												return dirty

						for i in range(len(_lowercase						) - 1						):
												clean += dirty[i]

												if dirty[i] == dirty[i + 1]:
																		clean += "X"

						clean += dirty[-1]

						if len(_lowercase						) & 1:
												clean += "X"

						return clean
def       A	(    _lowercase						):
						# I and J are used interchangeably to allow
						# us to use a 5x5 table (25 letters)
						SCREAMING_SNAKE_CASE							:    Optional[Any]							=							'''ABCDEFGHIKLMNOPQRSTUVWXYZ'''
						# we're using a list instead of a '2d' array because it makes the math
						# for setting up the table and doing the actual encoding/decoding simpler
						SCREAMING_SNAKE_CASE							:    List[Any]							=							[]

						# copy key chars into the table if they are in `alphabet` ignoring duplicates
						for char in key.upper():
												if char not in table and char in alphabet:
																		table.append(_lowercase						)

    # fill the rest of the table in with the remaining alphabet chars
						for char in alphabet:
												if char not in table:
																		table.append(_lowercase						)

						return table
def       A	(    _lowercase		,  _lowercase						):
						SCREAMING_SNAKE_CASE							:    Any							=							generate_table(_lowercase						)
						SCREAMING_SNAKE_CASE							:    Any							=							prepare_input(_lowercase						)
						SCREAMING_SNAKE_CASE							:    Union[str, Any]							=							''''''

						# https://en.wikipedia.org/wiki/Playfair_cipher#Description
						for chara, chara in chunker(_lowercase		,  2						):
												SCREAMING_SNAKE_CASE				,  SCREAMING_SNAKE_CASE							:    int							=							divmod(table.index(_lowercase						)		,  5						)
												SCREAMING_SNAKE_CASE				,  SCREAMING_SNAKE_CASE							:    Union[str, Any]							=							divmod(table.index(_lowercase						)		,  5						)

												if rowa == rowa:
																		ciphertext += table[rowa * 5 + (cola + 1) % 5]
																		ciphertext += table[rowa * 5 + (cola + 1) % 5]
												elif cola == cola:
																		ciphertext += table[((rowa + 1) % 5) * 5 + cola]
																		ciphertext += table[((rowa + 1) % 5) * 5 + cola]
												else:  # rectangle
																		ciphertext += table[rowa * 5 + cola]
																		ciphertext += table[rowa * 5 + cola]

						return ciphertext



def       A	(    _lowercase		,  _lowercase						):
						SCREAMING_SNAKE_CASE							:    Any							=							generate_table(_lowercase						)
						SCREAMING_SNAKE_CASE							:    List[Any]							=							''''''

						# https://en.wikipedia.org/wiki/Playfair_cipher#Description
						for chara, chara in chunker(_lowercase		,  2						):
												SCREAMING_SNAKE_CASE				,  SCREAMING_SNAKE_CASE							:    List[str]							=							divmod(table.index(_lowercase						)		,  5						)
												SCREAMING_SNAKE_CASE				,  SCREAMING_SNAKE_CASE							:    Optional[Any]							=							divmod(table.index(_lowercase						)		,  5						)

												if rowa == rowa:
																		plaintext += table[rowa * 5 + (cola - 1) % 5]
																		plaintext += table[rowa * 5 + (cola - 1) % 5]
												elif cola == cola:
																		plaintext += table[((rowa - 1) % 5) * 5 + cola]
																		plaintext += table[((rowa - 1) % 5) * 5 + cola]
												else:  # rectangle
																		plaintext += table[rowa * 5 + cola]
																		plaintext += table[rowa * 5 + cola]

						return plaintext





