




import numpy as np

__A        =    [
    ["a", "b", "c", "d", "e"],
    ["f", "g", "h", "i", "k"],
    ["l", "m", "n", "o", "p"],
    ["q", "r", "s", "t", "u"],
    ["v", "w", "x", "y", "z"],
]







class     __lowerCAmelCase :

			"""simple docstring"""







			def __init__(      self							)    ->      None:



							'''simple docstring'''
							__lowerCamelCase		       =    np.array(lowerCamelCase__							)


			def       lowercase_    (      self			,						lowerCamelCase__							)    ->      np.ndarray:



							'''simple docstring'''
							__lowerCamelCase       ,						__lowerCamelCase		       =    np.where(letter == self.SQUARE							)
							__lowerCamelCase		       =    np.concatenate([indexa + 1, indexa + 1]							)
							return indexes


			def       lowercase_    (      self			,						lowerCamelCase__			,						lowerCamelCase__							)    ->      str:



							'''simple docstring'''
							__lowerCamelCase		       =    self.SQUARE[indexa - 1, indexa - 1]
							return letter


			def       lowercase_    (      self			,						lowerCamelCase__							)    ->      str:



							'''simple docstring'''
							__lowerCamelCase		       =    message.lower()
							__lowerCamelCase		       =    message.replace(' '			,						''							)
							__lowerCamelCase		       =    message.replace('j'			,						'i'							)

							__lowerCamelCase		       =    np.empty((2, len(lowerCamelCase__							))							)
							for letter_index in range(len(lowerCamelCase__							)							):
											__lowerCamelCase		       =    self.letter_to_numbers(message[letter_index]							)

											__lowerCamelCase		       =    numbers[0]
											__lowerCamelCase		       =    numbers[1]

							__lowerCamelCase		       =    first_step.reshape(2 * len(lowerCamelCase__							)							)
							__lowerCamelCase		       =    ''
							for numbers_index in range(len(lowerCamelCase__							)							):
											__lowerCamelCase		       =    int(second_step[numbers_index * 2]							)
											__lowerCamelCase		       =    int(second_step[(numbers_index * 2) + 1]							)
											__lowerCamelCase		       =    self.numbers_to_letter(lowerCamelCase__			,						lowerCamelCase__							)
											__lowerCamelCase		       =    encoded_message + letter

							return encoded_message






			def       lowercase_    (      self			,						lowerCamelCase__							)    ->      str:



							'''simple docstring'''
							__lowerCamelCase		       =    message.lower()
							message.replace(' '			,						''							)
							__lowerCamelCase		       =    np.empty(2 * len(lowerCamelCase__							)							)
							for letter_index in range(len(lowerCamelCase__							)							):
											__lowerCamelCase		       =    self.letter_to_numbers(message[letter_index]							)
											__lowerCamelCase		       =    numbers[0]
											__lowerCamelCase		       =    numbers[1]

							__lowerCamelCase		       =    first_step.reshape((2, len(lowerCamelCase__							))							)
							__lowerCamelCase		       =    ''
							for numbers_index in range(len(lowerCamelCase__							)							):
											__lowerCamelCase		       =    int(second_step[0, numbers_index]							)
											__lowerCamelCase		       =    int(second_step[1, numbers_index]							)
											__lowerCamelCase		       =    self.numbers_to_letter(lowerCamelCase__			,						lowerCamelCase__							)
											__lowerCamelCase		       =    decoded_message + letter

							return decoded_message








class     __lowerCAmelCase :

			"""simple docstring"""







			def __init__(      self			,						lowerCamelCase__							)    ->      Any:



							'''simple docstring'''
							__lowerCamelCase		       =    n
							__lowerCamelCase		       =    [None] * self.n
							__lowerCamelCase		       =    0  # index of the first element
							__lowerCamelCase		       =    0
							__lowerCamelCase		       =    0


			def __len__(      self							)    ->      int:



							'''simple docstring'''
							return self.size


			def       lowercase_    (      self							)    ->      bool:



							'''simple docstring'''
							return self.size == 0


			def       lowercase_    (      self							)    ->      str:



							'''simple docstring'''
							return False if self.is_empty() else self.array[self.front]


			def       lowercase_    (      self			,						lowerCamelCase__							)    ->      Optional[Any]:



							'''simple docstring'''
							if self.size >= self.n:
											raise Exception('QUEUE IS FULL'							)

							__lowerCamelCase		       =    data
							__lowerCamelCase		       =    (self.rear + 1) % self.n
							self.size += 1
							return self






			def       lowercase_    (      self							)    ->      Tuple:



							'''simple docstring'''
							if self.size == 0:
											raise Exception('UNDERFLOW'							)

							__lowerCamelCase		       =    self.array[self.front]
							__lowerCamelCase		       =    None
							__lowerCamelCase		       =    (self.front + 1) % self.n
							self.size -= 1
							return temp


