






__UpperCAmelCase										=		[chr(i) for i in range(32, 126)]
__UpperCAmelCase										=		list(range(len(alphabets)))
__UpperCAmelCase										=		list(range(len(alphabets)))
__UpperCAmelCase										=		list(range(len(alphabets)))
__UpperCAmelCase										=		list(reversed(range(len(alphabets))))
__UpperCAmelCase										=		[]
__UpperCAmelCase										=		__UpperCAmelCase										=		__UpperCAmelCase										=		0




def   lowercase__   (  ):


     '''simple docstring'''


     global gear_one_pos
     global gear_two_pos
     global gear_three_pos
     UpperCAmelCase_					:   Any   =		gear_one[0]
     gear_one.append(lowercase_						)
     del gear_one[0]
     gear_one_pos += 1
     if gear_one_pos % int(len(lowercase_						)						) == 0:
          UpperCAmelCase_					:   str   =		gear_two[0]
          gear_two.append(lowercase_						)
          del gear_two[0]
          gear_two_pos += 1
          if gear_two_pos % int(len(lowercase_						)						) == 0:
               UpperCAmelCase_					:   int   =		gear_three[0]
               gear_three.append(lowercase_						)
               del gear_three[0]
               gear_three_pos += 1




def   lowercase__   (  __snake_case					:							List[Any]						):


     '''simple docstring'''


     UpperCAmelCase_					:   Dict   =		alphabets.index(lowercase_						)
     UpperCAmelCase_					:   Union[str, Any]   =		gear_one[target]
     UpperCAmelCase_					:   Any   =		gear_two[target]
     UpperCAmelCase_					:   Tuple   =		gear_three[target]
     UpperCAmelCase_					:   Tuple   =		reflector[target]
     UpperCAmelCase_					:   Any   =		gear_three.index(lowercase_						)
     UpperCAmelCase_					:   Any   =		gear_two.index(lowercase_						)
     UpperCAmelCase_					:   str   =		gear_one.index(lowercase_						)
     code.append(alphabets[target]						)
     rotator()


if __name__ == "__main__":
  __UpperCAmelCase										=		list(input('Type your message:\n'))
  while True:
    try:
      __UpperCAmelCase										=		int(input('Please set token:(must be only digits)\n'))
      break
    except Exception as error:
      print(error)
  for _ in range(token):
    rotator()
  for j in decode:
    engine(j)
  print('\n' + ''.join(code))
  print(
      F'\nYour Token is {token} please write it down.\nIf you want to decode '
      'this message again you should input same digits as token!'
  )














def   lowercase__   (  __snake_case					:							int  , __snake_case					:							int  , __snake_case					:							int  , __snake_case					:							int						):


					'''simple docstring'''


					return len_board * len_board_column * row + column




def   lowercase__   (  __snake_case					:							list[list[str]]  , __snake_case					:							str  , __snake_case					:							int  , __snake_case					:							int  , __snake_case					:							int  , __snake_case					:							set[int]  , ):


					'''simple docstring'''


					if board[row][column] != word[word_index]:
										return False

					if word_index == len(__snake_case						) - 1:
										return True

					UpperCAmelCase_					:   Dict   =		[(0, 1), (0, -1), (-1, 0), (1, 0)]
					UpperCAmelCase_					:   Union[str, Any]   =		len(__snake_case						)
					UpperCAmelCase_					:   List[Any]   =		len(board[0]						)
					for direction in traverts_directions:
										UpperCAmelCase_					:   Optional[int]   =		row + direction[0]
										UpperCAmelCase_					:   Optional[int]   =		column + direction[1]
										if not (0 <= next_i < len_board and 0 <= next_j < len_board_column):
															continue

										UpperCAmelCase_					:   Tuple   =		get_point_key(__snake_case  , __snake_case  , __snake_case  , __snake_case						)
										if key in visited_points_set:
															continue

										visited_points_set.add(__snake_case						)
										if exits_word(__snake_case  , __snake_case  , __snake_case  , __snake_case  , word_index + 1  , __snake_case						):
															return True

										visited_points_set.remove(__snake_case						)

					return False




def   lowercase__   (  __snake_case					:							list[list[str]]  , __snake_case					:							str						):


					'''simple docstring'''


					UpperCAmelCase_					:   Any   =		(
					    'The board should be a non empty matrix of single chars strings.'
					)

					UpperCAmelCase_					:   Optional[Any]   =		len(__snake_case						)
					if not isinstance(__snake_case  , __snake_case						) or len(__snake_case						) == 0:
										raise ValueError(__snake_case						)

					for row in board:
										if not isinstance(__snake_case  , __snake_case						) or len(__snake_case						) == 0:
															raise ValueError(__snake_case						)

										for item in row:
															if not isinstance(__snake_case  , __snake_case						) or len(__snake_case						) != 1:
																				raise ValueError(__snake_case						)

    # Validate word
					if not isinstance(__snake_case  , __snake_case						) or len(__snake_case						) == 0:
										raise ValueError(
										    'The word parameter should be a string of length greater than 0.'						)

					UpperCAmelCase_					:   Any   =		len(board[0]						)
					for i in range(__snake_case						):
										for j in range(__snake_case						):
															if exits_word(
															    __snake_case  , __snake_case  , __snake_case  , __snake_case  , 0  , {get_point_key(__snake_case  , __snake_case  , __snake_case  , __snake_case						)}						):
																				return True

					return False


if __name__ == "__main__":
		import doctest

		doctest.testmod()






