





'''simple docstring'''







import heapq






def    lowerCAmelCase__ (       lowerCamelCase  :    Dict						,lowerCamelCase  :    Optional[int]						,lowerCamelCase  :    str     ):
       _A  :			str											=      [(0, start)]  # cost from start node,end node
       _A  :			Optional[int]											=      set()
       while heap:
              (_A)  :			Optional[Any]											=      heapq.heappop(UpperCAmelCase_     )
              if u in visited:
                     continue
              visited.add(UpperCAmelCase_     )
              if u == end:
                     return cost
              for v, c in graph[u]:
                     if v in visited:
                            continue
                     _A  :			Dict											=      cost + c
                     heapq.heappush(UpperCAmelCase_						,(next_item, v)     )
       return -1


A   :  Optional[int]       		=				{
    '''A''': [['''B''', 2], ['''C''', 5]],
    '''B''': [['''A''', 2], ['''D''', 3], ['''E''', 1], ['''F''', 1]],
    '''C''': [['''A''', 5], ['''F''', 3]],
    '''D''': [['''B''', 3]],
    '''E''': [['''B''', 4], ['''F''', 3]],
    '''F''': [['''C''', 3], ['''E''', 3]],
}
A   :  Any       		=				{
    '''B''': [['''C''', 1]],
    '''C''': [['''D''', 1]],
    '''D''': [['''F''', 1]],
    '''E''': [['''B''', 1], ['''F''', 3]],
    '''F''': [],
}
A   :  List[str]       		=				{
    '''B''': [['''C''', 1]],
    '''C''': [['''D''', 1]],
    '''D''': [['''F''', 1]],
    '''E''': [['''B''', 1], ['''G''', 2]],
    '''F''': [],
    '''G''': [['''F''', 1]],
}

A   :  Union[str, Any]       		=				dijkstra(G, '''E''', '''C''')
print(short_distance)  # E -- 3 --> F -- 3 --> C == 6

A   :  Any       		=				dijkstra(Ga, '''E''', '''F''')
print(short_distance)  # E -- 3 --> F == 3

A   :  List[str]       		=				dijkstra(Ga, '''E''', '''F''')
print(short_distance)  # E -- 2 --> G -- 1 --> F == 3

if __name__ == "__main__":
   import doctest

   doctest.testmod()










'''simple docstring'''







import math






def    lowerCAmelCase__ (       lowerCamelCase  :    int     ):

       if 1 < number < 4:
              # 2 and 3 are primes
              return True
       elif number < 2 or number % 2 == 0 or number % 3 == 0:
              # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
              return False

       # All primes number are in format of 6k +/- 1
       for i in range(5						,int(math.sqrt(lowerCamelCase     ) + 1     )						,6     ):
              if number % i == 0 or number % (i + 2) == 0:
                     return False
       return True






def    lowerCAmelCase__ (       lowerCamelCase  :    int = 1000						,lowerCamelCase  :    int = 1000     ):
       _A  :			int											=      [0, 0, 0]  # length, a, b
       for a in range((a_limit * -1) + 1						,lowerCamelCase     ):
              for b in range(2						,lowerCamelCase     ):
                     if is_prime(lowerCamelCase     ):
                            _A  :			Dict											=      0
                            _A  :			Tuple											=      0
                            while is_prime((n**2) + (a * n) + b     ):
                                   count += 1
                                   n += 1
                            if count > longest[0]:
                                   _A  :			List[str]											=      [count, a, b]
       _A  :			str											=      longest[1] * longest[2]
       return ans


if __name__ == "__main__":
   print(solution(1000, 1000))






