input: from typing import List
  
  def find_minimum_walk_cost(n: int, edges: List[List[int]], queries: List[List[int]]) -> List[int]:
      """
      Consider an undirected graph with n vertices, numbered from 0 to n-1, and weighted edges.
  
      You are given an integer n and a list of edges where edges[i] = [u_i, v_i, w_i] signifies an edge between nodes u_i and v_i with a weight w_i.
  
      A walk in the graph consists of a sequence of vertices and edges, beginning and ending at a vertex, where each edge connects consecutive vertices in the sequence. Note that the walk can revisit the same vertex or edge multiple times.
  
      The cost of a walk from node u to node v is determined by the bitwise AND operation applied to the weights of the edges traversed in the walk. Specifically, if the weights encountered during the walk are w_0, w_1, ..., w_k, then the cost is computed as w_0 & w_1 & ... & w_k, utilizing the bitwise AND operator "&".
  
      Additionally, you are given a 2D list queries, where queries[i] = [s_i, t_i] asks for the minimum cost of a walk starting from vertex s_i and ending at vertex t_i. If no such walk is possible, the result should be -1.
  
      The function should return a list containing the minimum cost of the walk for each query in the queries list.
  
      Examples:
      >>> n = 5, edges = [[0,1,7],[1,3,7],[1,2,1]], queries = [[0,3],[3,4]]
      [1, -1]
      >>> n = 3, edges = [[0,2,7],[0,1,15],[1,2,6],[1,2,1]], queries = [[1,2]]
      [0]
  
      Constraints:
      - 2 <= n <= 100,000
      - 0 <= len(edges) <= 100,000
      - edges[i] should have exactly 3 elements
      - 0 <= u_i, v_i < n
      - u_i != v_i
      - 0 <= w_i <= 100,000
      - 1 <= len(queries) <= 100,000
      - queries[i] should have exactly 2 elements
      - 0 <= s_i, t_i < n
      - s_i != t_i
      """
output:     
      import heapq
      from collections import defaultdict
      from typing import List
  
      def dijkstra(start: int, n: int, graph: List[List[List[int]]]) -> List[int]:
          min_cost = [-1] * n
          min_cost[start] = float('inf')
          pq = [(-float('inf'), start)]
  
          while pq:
              curr_cost, u = heapq.heappop(pq)
              curr_cost = -curr_cost
  
              if curr_cost < min_cost[u]:
                  continue
  
              for v, weight in graph[u]:
                  new_cost = curr_cost & weight
                  if new_cost > min_cost[v]:
                      min_cost[v] = new_cost
                      heapq.heappush(pq, (-new_cost, v))
  
          return min_cost
  
      graph = defaultdict(list)
      for u, v, w in edges:
          graph[u].append((v, w))
          graph[v].append((u, w))
  
      results = []
      for s, t in queries:
          if s == t:
              results.append(0)
          else:
              min_cost_to_all = dijkstra(s, n, graph)
              results.append(min_cost_to_all[t])
  
      return results
  