code: 
  
  
  
  
  """simple docstring"""
  
  
  
  
  from __future__ import annotations
  class 							lowerCamelCase		:
  
  
  
  
  
  
  
     def __init__(							self    ,      SCREAMING_SNAKE_CASE_ ):
         UpperCamelCase				:   Dict          =							vertices
         UpperCamelCase				:   Optional[int]          =							[[0] * vertices for _ in range(SCREAMING_SNAKE_CASE_ )]
  
  
  
  
  
  
  
     def       a_							(							self    ,      SCREAMING_SNAKE_CASE_ ):
         print("""Vertex \t Distance from Source""" )
         for vertex in range(self.vertices ):
             print(SCREAMING_SNAKE_CASE_    ,      """\t\t"""    ,      distances_from_source[vertex] )
  
  
  
  
  
  
  
     def       a_							(							self    ,      SCREAMING_SNAKE_CASE_    ,      SCREAMING_SNAKE_CASE_ ):
         UpperCamelCase				:   int          =							1e7
         UpperCamelCase				:   str          =							0
  
         # Search not nearest vertex not in the shortest path tree
         for vertex in range(self.vertices ):
             if distances_from_source[vertex] < minimum and visited[vertex] is False:
                 UpperCamelCase				:   Optional[int]          =							distances_from_source[vertex]
                 UpperCamelCase				:   List[str]          =							vertex
         return min_index
  
  
  
  
  
  
  
     def       a_							(							self    ,      SCREAMING_SNAKE_CASE_ ):
         UpperCamelCase				:   int          =							[int(1e7 )] * self.vertices  # distances from the source
         UpperCamelCase				:   Dict          =							0
         UpperCamelCase				:   List[str]          =							[False] * self.vertices
  
         for _ in range(self.vertices ):
             UpperCamelCase				:   List[Any]          =							self.minimum_distance(SCREAMING_SNAKE_CASE_    ,      SCREAMING_SNAKE_CASE_ )
             UpperCamelCase				:   List[Any]          =							True
  
             # Update dist value of the adjacent vertices
             # of the picked vertex only if the current
             # distance is greater than new distance and
             # the vertex in not in the shortest path tree
             for v in range(self.vertices ):
                 if (
                     self.graph[u][v] > 0
                     and visited[v] is False
                     and distances[v] > distances[u] + self.graph[u][v]
                 ):
                     UpperCamelCase				:   List[Any]          =							distances[u] + self.graph[u][v]
  
         self.print_solution(SCREAMING_SNAKE_CASE_ )
  
  
  if __name__ == "__main__":
    __A :		List[str]      							=    Graph(9)
    __A :		Optional[int]      							=    [
        [0, 4, 0, 0, 0, 0, 0, 8, 0],
        [4, 0, 8, 0, 0, 0, 0, 11, 0],
        [0, 8, 0, 7, 0, 4, 0, 0, 2],
        [0, 0, 7, 0, 9, 14, 0, 0, 0],
        [0, 0, 0, 9, 0, 10, 0, 0, 0],
        [0, 0, 4, 14, 10, 0, 2, 0, 0],
        [0, 0, 0, 0, 0, 2, 0, 1, 6],
        [8, 11, 0, 0, 0, 0, 1, 0, 7],
        [0, 0, 2, 0, 0, 0, 6, 7, 0],
    ]
    graph.dijkstra(0)
  
  
  
  
  
style_context: 
  
  
  
  
  """simple docstring"""
  
  
  
  
  def 					A_			(		snake_case_     :       Tuple						,snake_case_     :       Optional[Any]						,snake_case_     :       Optional[Any]    ):
  
  
  
  
  
  
  
      '''simple docstring'''
      assert b != 0, "This cannot accept modulo that is == 0"
      if n == 0:
          return 1
  
      if n % 2 == 1:
          return (bin_exp_mod(snake_case_						,n - 1						,snake_case_    ) * a) % b
  
      UpperCamelCase				:   List[Any]          =							bin_exp_mod(snake_case_						,n / 2						,snake_case_    )
      return (r * r) % b
  
  
  if __name__ == "__main__":
    try:
      __A :		Any      							=    int(input('''Enter Base : ''').strip())
      __A :		Any      							=    int(input('''Enter Power : ''').strip())
      __A :		List[Any]      							=    int(input('''Enter Modulo : ''').strip())
    except ValueError:
      print('''Invalid literal for integer''')
  
    print(bin_exp_mod(BASE, POWER, MODULO))
  
  
  
  
  