




"""simple docstring"""







a      =							{
    'A': '.-', 'B': '-...', 'C': '-.-.', 'D': '-..', 'E': '.', 'F': '..-.', 'G': '--.',
    'H': '....', 'I': '..', 'J': '.---', 'K': '-.-', 'L': '.-..', 'M': '--', 'N': '-.',
    'O': '---', 'P': '.--.', 'Q': '--.-', 'R': '.-.', 'S': '...', 'T': '-', 'U': '..-',
    'V': '...-', 'W': '.--', 'X': '-..-', 'Y': '-.--', 'Z': '--..', '1': '.----',
    '2': '..---', '3': '...--', '4': '....-', '5': '.....', '6': '-....', '7': '--...',
    '8': '---..', '9': '----.', '0': '-----', '&': '.-...', '@': '.--.-.',
    ':': '---...', ',': '--..--', '.': '.-.-.-', '\'': '.----.', '"': '.-..-.',
    '?': '..--..', '/': '-..-.', '=': '-...-', '+': '.-.-.', '-': '-....-',
    '(': '-.--.', ')': '-.--.-', '!': '-.-.--', ' ': '/'
}  # Exclamation mark is not in ITU-R recommendation
# fmt: on
a      =							{value: key for key, value in MORSE_CODE_DICT.items()}





def 							lowercase					(snake_case__   : str )     ->  str:


				'''simple docstring'''






				return " ".join(MORSE_CODE_DICT[char] for char in message.upper() )





def 							lowercase					(snake_case__   : str )     ->  str:


				'''simple docstring'''






				return "".join(REVERSE_DICT[char] for char in message.split() )





def 							lowercase					()     ->  None:


				'''simple docstring'''






				lowerCAmelCase  =				"""Morse code here!"""
				print(snake_case__ )
				lowerCAmelCase  =				encrypt(snake_case__ )
				print(snake_case__ )
				lowerCAmelCase  =				decrypt(snake_case__ )
				print(snake_case__ )


if __name__ == "__main__":
		main()











"""simple docstring"""







from collections import deque
from math import floor
from random import random
from time import time






class       SCREAMING_SNAKE_CASE__					:


						def __init__(							self				:			Union[str, Any]					):
										lowerCAmelCase  =				{}


						def   __lowercase (							self				:			Optional[int]						,						lowerCAmelCase				:			Union[str, Any]						,						lowerCAmelCase				:			Optional[Any]						,						lowerCAmelCase				:			Union[str, Any]=1					):
										if self.graph.get(lowerCAmelCase					):
														if self.graph[u].count([w, v]					) == 0:
																		self.graph[u].append([w, v]					)
										else:
														lowerCAmelCase  =				[[w, v]]
										if not self.graph.get(lowerCAmelCase					):
														lowerCAmelCase  =				[]


						def   __lowercase (							self				:			Optional[int]					):
										return list(self.graph					)


						def   __lowercase (							self				:			Optional[Any]						,						lowerCAmelCase				:			Optional[Any]						,						lowerCAmelCase				:			Dict					):
										if self.graph.get(lowerCAmelCase					):
														for _ in self.graph[u]:
																		if _[1] == v:
																						self.graph[u].remove(lowerCAmelCase					)


						def   __lowercase (							self				:			List[str]						,						lowerCAmelCase				:			Tuple=-2						,						lowerCAmelCase				:			List[Any]=-1					):
										if s == d:
														return []
										lowerCAmelCase  =				[]
										lowerCAmelCase  =				[]
										if s == -2:
														lowerCAmelCase  =				list(self.graph					)[0]
										stack.append(lowerCAmelCase					)
										visited.append(lowerCAmelCase					)
										lowerCAmelCase  =				s

										while True:
														# check if there is any non isolated nodes
														if len(self.graph[s]					) != 0:
																		lowerCAmelCase  =				s
																		for node in self.graph[s]:
																						if visited.count(node[1]					) < 1:
																										if node[1] == d:
																														visited.append(lowerCAmelCase					)
																														return visited
																										else:
																														stack.append(node[1]					)
																														visited.append(node[1]					)
																														lowerCAmelCase  =				node[1]
																														break

            # check if all the children are visited
														if s == ss:
																		stack.pop()
																		if len(lowerCAmelCase					) != 0:
																						lowerCAmelCase  =				stack[len(lowerCAmelCase					) - 1]
														else:
																		lowerCAmelCase  =				ss

														# check if se have reached the starting point
														if len(lowerCAmelCase					) == 0:
																		return visited


						def   __lowercase (							self				:			Tuple						,						lowerCAmelCase				:			Any=-1					):
										if c == -1:
														lowerCAmelCase  =				floor(random() * 1_0000					) + 10
										for i in range(lowerCAmelCase					):
														# every vertex has max 100 edges
														for _ in range(floor(random() * 102					) + 1					):
																		lowerCAmelCase  =				floor(random() * c					) + 1
																		if n != i:
																						self.add_pair(lowerCAmelCase						,						lowerCAmelCase						,						1					)


						def   __lowercase (							self				:			Optional[int]						,						lowerCAmelCase				:			List[str]=-2					):
										lowerCAmelCase  =				deque()
										lowerCAmelCase  =				[]
										if s == -2:
														lowerCAmelCase  =				list(self.graph					)[0]
										d.append(lowerCAmelCase					)
										visited.append(lowerCAmelCase					)
										while d:
														lowerCAmelCase  =				d.popleft()
														if len(self.graph[s]					) != 0:
																		for node in self.graph[s]:
																						if visited.count(node[1]					) < 1:
																										d.append(node[1]					)
																										visited.append(node[1]					)
										return visited


						def   __lowercase (							self				:			List[Any]						,						lowerCAmelCase				:			Union[str, Any]					):
										lowerCAmelCase  =				0
										for x in self.graph:
														for y in self.graph[x]:
																		if y[1] == u:
																						count += 1
										return count


						def   __lowercase (							self				:			int						,						lowerCAmelCase				:			Tuple					):
										return len(self.graph[u]					)


						def   __lowercase (							self				:			Optional[int]						,						lowerCAmelCase				:			Optional[Any]=-2					):
										lowerCAmelCase  =				[]
										lowerCAmelCase  =				[]
										if s == -2:
														lowerCAmelCase  =				list(self.graph					)[0]
										stack.append(lowerCAmelCase					)
										visited.append(lowerCAmelCase					)
										lowerCAmelCase  =				s
										lowerCAmelCase  =				[]

										while True:
														# check if there is any non isolated nodes
														if len(self.graph[s]					) != 0:
																		lowerCAmelCase  =				s
																		for node in self.graph[s]:
																						if visited.count(node[1]					) < 1:
																										stack.append(node[1]					)
																										visited.append(node[1]					)
																										lowerCAmelCase  =				node[1]
																										break

            # check if all the children are visited
														if s == ss:
																		sorted_nodes.append(stack.pop()					)
																		if len(lowerCAmelCase					) != 0:
																						lowerCAmelCase  =				stack[len(lowerCAmelCase					) - 1]
														else:
																		lowerCAmelCase  =				ss

														# check if se have reached the starting point
														if len(lowerCAmelCase					) == 0:
																		return sorted_nodes


						def   __lowercase (							self				:			Any					):
										lowerCAmelCase  =				[]
										lowerCAmelCase  =				[]
										lowerCAmelCase  =				list(self.graph					)[0]
										stack.append(lowerCAmelCase					)
										visited.append(lowerCAmelCase					)
										lowerCAmelCase  =				-2
										lowerCAmelCase  =				[]
										lowerCAmelCase  =				s
										lowerCAmelCase  =				False
										lowerCAmelCase  =				set()

										while True:
														# check if there is any non isolated nodes
														if len(self.graph[s]					) != 0:
																		lowerCAmelCase  =				s
																		for node in self.graph[s]:
																						if (
																						    visited.count(node[1]					) > 0
																						    and node[1] != parent
																						    and indirect_parents.count(node[1]					) > 0
																						    and not on_the_way_back
																						):
																										lowerCAmelCase  =				len(lowerCAmelCase					) - 1
																										while len_stack >= 0:
																														if stack[len_stack] == node[1]:
																																		anticipating_nodes.add(node[1]					)
																																		break
																														else:
																																		anticipating_nodes.add(stack[len_stack]					)
																																		len_stack -= 1
																						if visited.count(node[1]					) < 1:
																										stack.append(node[1]					)
																										visited.append(node[1]					)
																										lowerCAmelCase  =				node[1]
																										break

            # check if all the children are visited
														if s == ss:
																		stack.pop()
																		lowerCAmelCase  =				True
																		if len(lowerCAmelCase					) != 0:
																						lowerCAmelCase  =				stack[len(lowerCAmelCase					) - 1]
														else:
																		lowerCAmelCase  =				False
																		indirect_parents.append(lowerCAmelCase					)
																		lowerCAmelCase  =				s
																		lowerCAmelCase  =				ss

														# check if se have reached the starting point
														if len(lowerCAmelCase					) == 0:
																		return list(lowerCAmelCase					)


						def   __lowercase (							self				:			Tuple					):
										lowerCAmelCase  =				[]
										lowerCAmelCase  =				[]
										lowerCAmelCase  =				list(self.graph					)[0]
										stack.append(lowerCAmelCase					)
										visited.append(lowerCAmelCase					)
										lowerCAmelCase  =				-2
										lowerCAmelCase  =				[]
										lowerCAmelCase  =				s
										lowerCAmelCase  =				False
										lowerCAmelCase  =				set()

										while True:
														# check if there is any non isolated nodes
														if len(self.graph[s]					) != 0:
																		lowerCAmelCase  =				s
																		for node in self.graph[s]:
																						if (
																						    visited.count(node[1]					) > 0
																						    and node[1] != parent
																						    and indirect_parents.count(node[1]					) > 0
																						    and not on_the_way_back
																						):
																										lowerCAmelCase  =				len(lowerCAmelCase					) - 1
																										while len_stack_minus_one >= 0:
																														if stack[len_stack_minus_one] == node[1]:
																																		anticipating_nodes.add(node[1]					)
																																		break
																														else:
																																		return True
																						if visited.count(node[1]					) < 1:
																										stack.append(node[1]					)
																										visited.append(node[1]					)
																										lowerCAmelCase  =				node[1]
																										break

            # check if all the children are visited
														if s == ss:
																		stack.pop()
																		lowerCAmelCase  =				True
																		if len(lowerCAmelCase					) != 0:
																						lowerCAmelCase  =				stack[len(lowerCAmelCase					) - 1]
														else:
																		lowerCAmelCase  =				False
																		indirect_parents.append(lowerCAmelCase					)
																		lowerCAmelCase  =				s
																		lowerCAmelCase  =				ss

														# check if se have reached the starting point
														if len(lowerCAmelCase					) == 0:
																		return False


						def   __lowercase (							self				:			List[Any]						,						lowerCAmelCase				:			Any=-2						,						lowerCAmelCase				:			Tuple=-1					):
										lowerCAmelCase  =				time()
										self.dfs(lowerCAmelCase						,						lowerCAmelCase					)
										lowerCAmelCase  =				time()
										return end - begin




						def   __lowercase (							self				:			int						,						lowerCAmelCase				:			str=-2					):
										lowerCAmelCase  =				time()
										self.bfs(lowerCAmelCase					)
										lowerCAmelCase  =				time()
										return end - begin






class       SCREAMING_SNAKE_CASE__					:


						def __init__(							self				:			int					):
										lowerCAmelCase  =				{}


						def   __lowercase (							self				:			Optional[Any]						,						lowerCAmelCase				:			Tuple						,						lowerCAmelCase				:			str						,						lowerCAmelCase				:			str=1					):
										# check if the u exists
										if self.graph.get(lowerCAmelCase					):
														# if there already is a edge
														if self.graph[u].count([w, v]					) == 0:
																		self.graph[u].append([w, v]					)
										else:
														# if u does not exist
														lowerCAmelCase  =				[[w, v]]
										# add the other way
										if self.graph.get(lowerCAmelCase					):
														# if there already is a edge
														if self.graph[v].count([w, u]					) == 0:
																		self.graph[v].append([w, u]					)
										else:
														# if u does not exist
														lowerCAmelCase  =				[[w, u]]


						def   __lowercase (							self				:			Dict						,						lowerCAmelCase				:			Any						,						lowerCAmelCase				:			int					):
										if self.graph.get(lowerCAmelCase					):
														for _ in self.graph[u]:
																		if _[1] == v:
																						self.graph[u].remove(lowerCAmelCase					)
        # the other way round
										if self.graph.get(lowerCAmelCase					):
														for _ in self.graph[v]:
																		if _[1] == u:
																						self.graph[v].remove(lowerCAmelCase					)


						def   __lowercase (							self				:			Dict						,						lowerCAmelCase				:			Optional[int]=-2						,						lowerCAmelCase				:			Optional[Any]=-1					):
										if s == d:
														return []
										lowerCAmelCase  =				[]
										lowerCAmelCase  =				[]
										if s == -2:
														lowerCAmelCase  =				list(self.graph					)[0]
										stack.append(lowerCAmelCase					)
										visited.append(lowerCAmelCase					)
										lowerCAmelCase  =				s

										while True:
														# check if there is any non isolated nodes
														if len(self.graph[s]					) != 0:
																		lowerCAmelCase  =				s
																		for node in self.graph[s]:
																						if visited.count(node[1]					) < 1:
																										if node[1] == d:
																														visited.append(lowerCAmelCase					)
																														return visited
																										else:
																														stack.append(node[1]					)
																														visited.append(node[1]					)
																														lowerCAmelCase  =				node[1]
																														break

            # check if all the children are visited
														if s == ss:
																		stack.pop()
																		if len(lowerCAmelCase					) != 0:
																						lowerCAmelCase  =				stack[len(lowerCAmelCase					) - 1]
														else:
																		lowerCAmelCase  =				ss

														# check if se have reached the starting point
														if len(lowerCAmelCase					) == 0:
																		return visited


						def   __lowercase (							self				:			Any						,						lowerCAmelCase				:			Dict=-1					):
										if c == -1:
														lowerCAmelCase  =				floor(random() * 1_0000					) + 10
										for i in range(lowerCAmelCase					):
														# every vertex has max 100 edges
														for _ in range(floor(random() * 102					) + 1					):
																		lowerCAmelCase  =				floor(random() * c					) + 1
																		if n != i:
																						self.add_pair(lowerCAmelCase						,						lowerCAmelCase						,						1					)


						def   __lowercase (							self				:			int						,						lowerCAmelCase				:			Tuple=-2					):
										lowerCAmelCase  =				deque()
										lowerCAmelCase  =				[]
										if s == -2:
														lowerCAmelCase  =				list(self.graph					)[0]
										d.append(lowerCAmelCase					)
										visited.append(lowerCAmelCase					)
										while d:
														lowerCAmelCase  =				d.popleft()
														if len(self.graph[s]					) != 0:
																		for node in self.graph[s]:
																						if visited.count(node[1]					) < 1:
																										d.append(node[1]					)
																										visited.append(node[1]					)
										return visited


						def   __lowercase (							self				:			List[str]						,						lowerCAmelCase				:			str					):
										return len(self.graph[u]					)


						def   __lowercase (							self				:			Optional[Any]					):
										lowerCAmelCase  =				[]
										lowerCAmelCase  =				[]
										lowerCAmelCase  =				list(self.graph					)[0]
										stack.append(lowerCAmelCase					)
										visited.append(lowerCAmelCase					)
										lowerCAmelCase  =				-2
										lowerCAmelCase  =				[]
										lowerCAmelCase  =				s
										lowerCAmelCase  =				False
										lowerCAmelCase  =				set()

										while True:
														# check if there is any non isolated nodes
														if len(self.graph[s]					) != 0:
																		lowerCAmelCase  =				s
																		for node in self.graph[s]:
																						if (
																						    visited.count(node[1]					) > 0
																						    and node[1] != parent
																						    and indirect_parents.count(node[1]					) > 0
																						    and not on_the_way_back
																						):
																										lowerCAmelCase  =				len(lowerCAmelCase					) - 1
																										while len_stack >= 0:
																														if stack[len_stack] == node[1]:
																																		anticipating_nodes.add(node[1]					)
																																		break
																														else:
																																		anticipating_nodes.add(stack[len_stack]					)
																																		len_stack -= 1
																						if visited.count(node[1]					) < 1:
																										stack.append(node[1]					)
																										visited.append(node[1]					)
																										lowerCAmelCase  =				node[1]
																										break

            # check if all the children are visited
														if s == ss:
																		stack.pop()
																		lowerCAmelCase  =				True
																		if len(lowerCAmelCase					) != 0:
																						lowerCAmelCase  =				stack[len(lowerCAmelCase					) - 1]
														else:
																		lowerCAmelCase  =				False
																		indirect_parents.append(lowerCAmelCase					)
																		lowerCAmelCase  =				s
																		lowerCAmelCase  =				ss

														# check if se have reached the starting point
														if len(lowerCAmelCase					) == 0:
																		return list(lowerCAmelCase					)


						def   __lowercase (							self				:			int					):
										lowerCAmelCase  =				[]
										lowerCAmelCase  =				[]
										lowerCAmelCase  =				list(self.graph					)[0]
										stack.append(lowerCAmelCase					)
										visited.append(lowerCAmelCase					)
										lowerCAmelCase  =				-2
										lowerCAmelCase  =				[]
										lowerCAmelCase  =				s
										lowerCAmelCase  =				False
										lowerCAmelCase  =				set()

										while True:
														# check if there is any non isolated nodes
														if len(self.graph[s]					) != 0:
																		lowerCAmelCase  =				s
																		for node in self.graph[s]:
																						if (
																						    visited.count(node[1]					) > 0
																						    and node[1] != parent
																						    and indirect_parents.count(node[1]					) > 0
																						    and not on_the_way_back
																						):
																										lowerCAmelCase  =				len(lowerCAmelCase					) - 1
																										while len_stack_minus_one >= 0:
																														if stack[len_stack_minus_one] == node[1]:
																																		anticipating_nodes.add(node[1]					)
																																		break
																														else:
																																		return True
																						if visited.count(node[1]					) < 1:
																										stack.append(node[1]					)
																										visited.append(node[1]					)
																										lowerCAmelCase  =				node[1]
																										break

            # check if all the children are visited
														if s == ss:
																		stack.pop()
																		lowerCAmelCase  =				True
																		if len(lowerCAmelCase					) != 0:
																						lowerCAmelCase  =				stack[len(lowerCAmelCase					) - 1]
														else:
																		lowerCAmelCase  =				False
																		indirect_parents.append(lowerCAmelCase					)
																		lowerCAmelCase  =				s
																		lowerCAmelCase  =				ss

														# check if se have reached the starting point
														if len(lowerCAmelCase					) == 0:
																		return False


						def   __lowercase (							self				:			str					):
										return list(self.graph					)


						def   __lowercase (							self				:			Dict						,						lowerCAmelCase				:			Dict=-2						,						lowerCAmelCase				:			List[str]=-1					):
										lowerCAmelCase  =				time()
										self.dfs(lowerCAmelCase						,						lowerCAmelCase					)
										lowerCAmelCase  =				time()
										return end - begin




						def   __lowercase (							self				:			str						,						lowerCAmelCase				:			Union[str, Any]=-2					):
										lowerCAmelCase  =				time()
										self.bfs(lowerCAmelCase					)
										lowerCAmelCase  =				time()
										return end - begin





