

import sys
from collections import defaultdict






class 						__magic_name__    :


 def __init__(						self		: Optional[int]    )    ->      Tuple:
   UpperCAmelCase					      =  []


 def _UpperCamelCase	(						self		: Optional[Any]			,						lowerCAmelCase__		: int    )    ->      Dict:
   return self.node_position[vertex]


 def _UpperCamelCase	(						self		: Optional[int]			,						lowerCAmelCase__		: Optional[int]			,						lowerCAmelCase__		: List[Any]    )    ->      Dict:
   UpperCAmelCase					      =  pos


 def _UpperCamelCase	(						self		: int			,						lowerCAmelCase__		: List[Any]			,						lowerCAmelCase__		: Optional[int]			,						lowerCAmelCase__		: List[Any]			,						lowerCAmelCase__		: Optional[int]    )    ->      List[str]:
   if start > size // 2 - 1:
     return
   else:
     if 2 * start + 2 >= size:
       UpperCAmelCase					      =  2 * start + 1
     else:
       if heap[2 * start + 1] < heap[2 * start + 2]:
         UpperCAmelCase					      =  2 * start + 1
       else:
         UpperCAmelCase					      =  2 * start + 2
     if heap[smallest_child] < heap[start]:
       UpperCAmelCase					      =  heap[smallest_child], positions[smallest_child]
       UpperCAmelCase					      =  (
           heap[start],
           positions[start],
       )
       UpperCAmelCase					      =  temp, tempa

       UpperCAmelCase					      =  self.get_position(positions[smallest_child]    )
       self.set_position(
           positions[smallest_child]			,						self.get_position(positions[start]    )    )
       self.set_position(positions[start]			,						UpperCamelCase_    )

       self.top_to_bottom(UpperCamelCase_			,						UpperCamelCase_			,						UpperCamelCase_			,						UpperCamelCase_    )


 def _UpperCamelCase	(						self		: int			,						lowerCAmelCase__		: str			,						lowerCAmelCase__		: Any			,						lowerCAmelCase__		: Dict			,						lowerCAmelCase__		: Union[str, Any]    )    ->      Union[str, Any]:
   UpperCAmelCase					      =  position[index]

   while index != 0:
     UpperCAmelCase					      =  int((index - 2) / 2    ) if index % 2 == 0 else int((index - 1) / 2    )

     if val < heap[parent]:
       UpperCAmelCase					      =  heap[parent]
       UpperCAmelCase					      =  position[parent]
       self.set_position(position[parent]			,						UpperCamelCase_    )
     else:
       UpperCAmelCase					      =  val
       UpperCAmelCase					      =  temp
       self.set_position(UpperCamelCase_			,						UpperCamelCase_    )
       break
     UpperCAmelCase					      =  parent
   else:
     UpperCAmelCase					      =  val
     UpperCAmelCase					      =  temp
     self.set_position(UpperCamelCase_			,						0    )


 def _UpperCamelCase	(						self		: Any			,						lowerCAmelCase__		: List[Any]			,						lowerCAmelCase__		: Dict    )    ->      List[str]:
   UpperCAmelCase					      =  len(UpperCamelCase_    ) // 2 - 1
   for i in range(UpperCamelCase_			,						-1			,						-1    ):
     self.top_to_bottom(UpperCamelCase_			,						UpperCamelCase_			,						len(UpperCamelCase_    )			,						UpperCamelCase_    )


 def _UpperCamelCase	(						self		: List[Any]			,						lowerCAmelCase__		: List[Any]			,						lowerCAmelCase__		: Any    )    ->      int:
   UpperCAmelCase					      =  positions[0]
   UpperCAmelCase					      =  sys.maxsize
   self.top_to_bottom(UpperCamelCase_			,						0			,						len(UpperCamelCase_    )			,						UpperCamelCase_    )
   return temp

def      _lowerCAmelCase(	__A			):
  UpperCAmelCase					      =  Heap()

  UpperCAmelCase					      =  [0] * len(lowerCamelCase__			)
  UpperCAmelCase					      =  [-1] * len(lowerCamelCase__			)  # Neighboring Tree Vertex of selected vertex
  # Minimum Distance of explored vertex with neighboring vertex of partial tree
  # formed in graph
  UpperCAmelCase					      =  []  # Heap of Distance of vertices from their neighboring vertex
  UpperCAmelCase					      =  []

  for vertex in range(len(lowerCamelCase__			)			):
    distance_tv.append(sys.maxsize			)
    positions.append(lowerCamelCase__			)
    heap.node_position.append(lowerCamelCase__			)

  UpperCAmelCase					      =  []
  UpperCAmelCase					      =  1
  UpperCAmelCase					      =  sys.maxsize
  for neighbor, distance in adjacency_list[0]:
    UpperCAmelCase					      =  0
    UpperCAmelCase					      =  distance
  heap.heapify(lowerCamelCase__   ,       lowerCamelCase__			)

  for _ in range(1   ,       len(lowerCamelCase__			)			):
    UpperCAmelCase					      =  heap.delete_minimum(lowerCamelCase__   ,       lowerCamelCase__			)
    if visited[vertex] == 0:
      tree_edges.append((nbr_tv[vertex], vertex)			)
      UpperCAmelCase					      =  1
      for neighbor, distance in adjacency_list[vertex]:
        if (
            visited[neighbor] == 0
            and distance < distance_tv[heap.get_position(lowerCamelCase__			)]
        ):
          UpperCAmelCase					      =  distance
          heap.bottom_to_top(
              lowerCamelCase__   ,       heap.get_position(lowerCamelCase__			)   ,       lowerCamelCase__   ,       lowerCamelCase__			)
          UpperCAmelCase					      =  vertex
  return tree_edges


if __name__ == "__main__":  # pragma: no cover
      # < --------- Prims Algorithm --------- >
      lowerCAmelCase__       = int(input("Enter number of edges: ").strip())
      lowerCAmelCase__       = defaultdict(list)
      for _ in range(edges_number):
            lowerCAmelCase__       = [int(x) for x in input().strip().split()]
            adjacency_list[edge[0]].append([edge[1], edge[2]])
            adjacency_list[edge[1]].append([edge[0], edge[2]])
      print(prisms_algorithm(adjacency_list))






from __future__ import annotations

import json

import requests
from bsa import BeautifulSoup
from fake_useragent import UserAgent

lowerCAmelCase__       = {"UserAgent": UserAgent().random}
def      _lowerCAmelCase(	__A			):
  UpperCAmelCase					      =  script.contents[0]
  UpperCAmelCase					      =  json.loads(data[data.find("{\"config\""			) : -1]			)
  return info["entry_data"]["ProfilePage"][0]["graphql"]["user"]






class 						__magic_name__    :


 def __init__(						self		: Optional[Any]			,						lowerCAmelCase__		: Optional[int]    )    ->      Any:
   UpperCAmelCase					      =  f"https://www.instagram.com/{username}/"
   UpperCAmelCase					      =  self.get_json()


 def _UpperCamelCase	(						self		: List[str]    )    ->      dict:
   UpperCAmelCase					      =  requests.get(self.url			,						headers=lowerCAmelCase__    ).text
   UpperCAmelCase					      =  BeautifulSoup(lowerCAmelCase__			,						"html.parser"    ).find_all("script"    )
   try:
     return extract_user_profile(scripts[4]    )
   except (json.decoder.JSONDecodeError, KeyError):
     return extract_user_profile(scripts[3]    )


 def __repr__(						self		: Tuple    )    ->      str:
   return f"{self.__class__.__name__}('{self.username}')"


 def __str__(						self		: Optional[int]    )    ->      str:
   return f"{self.fullname} ({self.username}) is {self.biography}"


 @property
 def _UpperCamelCase	(						self		: Any    )    ->      str:
   return self.user_data["username"]


 @property
 def _UpperCamelCase	(						self		: List[Any]    )    ->      str:
   return self.user_data["full_name"]


 @property
 def _UpperCamelCase	(						self		: List[str]    )    ->      str:
   return self.user_data["biography"]


 @property
 def _UpperCamelCase	(						self		: Optional[int]    )    ->      str:
   return self.user_data["business_email"]


 @property
 def _UpperCamelCase	(						self		: str    )    ->      str:
   return self.user_data["external_url"]


 @property
 def _UpperCamelCase	(						self		: int    )    ->      int:
   return self.user_data["edge_followed_by"]["count"]


 @property
 def _UpperCamelCase	(						self		: List[Any]    )    ->      int:
   return self.user_data["edge_follow"]["count"]


 @property
 def _UpperCamelCase	(						self		: List[str]    )    ->      int:
   return self.user_data["edge_owner_to_timeline_media"]["count"]


 @property
 def _UpperCamelCase	(						self		: Tuple    )    ->      str:
   return self.user_data["profile_pic_url_hd"]


 @property
 def _UpperCamelCase	(						self		: Optional[int]    )    ->      bool:
   return self.user_data["is_verified"]


 @property
 def _UpperCamelCase	(						self		: Optional[Any]    )    ->      bool:
   return self.user_data["is_private"]

def      _lowerCAmelCase(	__A = "github"			):
  import os

  if os.environ.get("CI"			):
    return  # test failing on GitHub Actions
  UpperCAmelCase					      =  InstagramUser(__A			)
  assert instagram_user.user_data
  assert isinstance(instagram_user.user_data   ,       __A			)
  assert instagram_user.username == username
  if username != "github":
    return
  assert instagram_user.fullname == "GitHub"
  assert instagram_user.biography == "Built for developers."
  assert instagram_user.number_of_posts > 150
  assert instagram_user.number_of_followers > 120000
  assert instagram_user.number_of_followings > 15
  assert instagram_user.email == "support@github.com"
  assert instagram_user.website == "https://github.com/readme"
  assert instagram_user.profile_picture_url.startswith("https://instagram."			)
  assert instagram_user.is_verified is True
  assert instagram_user.is_private is False


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      lowerCAmelCase__       = InstagramUser("github")
      print(instagram_user)
      print(f"{instagram_user.number_of_posts = }")
      print(f"{instagram_user.number_of_followers = }")
      print(f"{instagram_user.number_of_followings = }")
      print(f"{instagram_user.email = }")
      print(f"{instagram_user.website = }")
      print(f"{instagram_user.profile_picture_url = }")
      print(f"{instagram_user.is_verified = }")
      print(f"{instagram_user.is_private = }")



