
from __future__ import annotations

from queue import Queue





class 							A__		:
						def __init__(				self				):
							lowerCamelCase		:     Dict          =				{}
						def 						UpperCamelCase__							(				self				):




							for i in self.vertices:
								print(__SCREAMING_SNAKE_CASE   ,  """ : """   ,  """ -> """.join([str(__SCREAMING_SNAKE_CASE				) for j in self.vertices[i]]				)				)
						def 						UpperCamelCase__							(				self   ,  __magic_name__   ,  __magic_name__				):




							if from_vertex in self.vertices:
								self.vertices[from_vertex].append(__SCREAMING_SNAKE_CASE				)
							else:
								lowerCamelCase		:     List[str]          =				[to_vertex]






						def 						UpperCamelCase__							(				self   ,  __magic_name__				):
							lowerCamelCase		:     Optional[int]          =				set()

							# create a first in first out queue to store all the vertices for BFS
							lowerCamelCase		:     int          =				Queue()

							# mark the source node as visited and enqueue it
							visited.add(__SCREAMING_SNAKE_CASE				)
							queue.put(__SCREAMING_SNAKE_CASE				)

							while not queue.empty():
								lowerCamelCase		:     str          =				queue.get()

								# loop through all adjacent vertex and enqueue it if not yet visited
								for adjacent_vertex in self.vertices[vertex]:
									if adjacent_vertex not in visited:
										queue.put(__SCREAMING_SNAKE_CASE				)
										visited.add(__SCREAMING_SNAKE_CASE				)
							return visited


if __name__ == "__main__":
						from doctest import testmod

						testmod(verbose=True)

						_lowerCamelCase        =Graph()
						g.add_edge(0, 1)
						g.add_edge(0, 2)
						g.add_edge(1, 2)
						g.add_edge(2, 0)
						g.add_edge(2, 3)
						g.add_edge(3, 3)

						g.print_graph()
						# 0  :  1 -> 2
						# 1  :  2
						# 2  :  0 -> 3
						# 3  :  3

						assert sorted(g.bfs(2)) == [0, 1, 2, 3]






from collections import defaultdict





def    _a (						lowerCamelCase							):
 lowerCamelCase		:     defaultdict[str, int]          =				defaultdict(lowerCamelCase							)
 # Creating a dictionary containing count of each word
 for word in sentence.split():
  occurrence[word] += 1
 return occurrence


if __name__ == "__main__":
      for word, count in word_occurrence("""INPUT STRING""").items():
            print(f'''{word}: {count}''')




