




import heapq as hq
import math
from collections.abc import Iterator


class    lowerCamelCase    :






   '''simple docstring'''





   def __init__( self			:   Any       ,						lowerCamelCase_			:   List[str]  )						->   Optional[int]:
        __magic_name__							:	Union[str, Any]    							=							str(id_  )
        __magic_name__							:	Union[str, Any]    							=							None
        __magic_name__							:	Any    							=							None
        __magic_name__							:	Dict    							=							[]
        __magic_name__							:	Any    							=							{}  # {vertex:distance}

   def __lt__( self			:   Any       ,						lowerCamelCase_			:   Optional[Any]  )						->   Dict:
        return self.key < other.key

   def __repr__( self			:   Optional[Any]  )						->   Union[str, Any]:
        return self.id

   def 							UpperCAmelCase__       ( self			:   int       ,						lowerCamelCase_			:   Any  )						->   List[Any]:
        self.neighbors.append(lowercase_  )


   def 							UpperCAmelCase__       ( self			:   Any       ,						lowerCamelCase_			:   Tuple       ,						lowerCamelCase_			:   int  )						->   List[Any]:
        __magic_name__							:	Dict    							=							weight







def 		lowercase__   (		__A:	str							,__A:	List[Any]							,__A:	Union[str, Any]							,__A:	int				):





     '''simple docstring'''






     graph[a - 1].add_neighbor(graph[b - 1]				)
     graph[b - 1].add_neighbor(graph[a - 1]				)
     # add the edges:
     graph[a - 1].add_edge(graph[b - 1]							,a__				)
     graph[b - 1].add_edge(graph[a - 1]							,a__				)







def 		lowercase__   (		__A:	str							,__A:	List[str]				):





     '''simple docstring'''






     __magic_name__							:	Dict    							=							[]
     for u in graph:
          __magic_name__							:	Union[str, Any]    							=							math.inf
          __magic_name__							:	List[Any]    							=							None
     __magic_name__							:	Dict    							=							0
     __magic_name__							:	Union[str, Any]    							=							graph[:]
     while q:
          __magic_name__							:	List[Any]    							=							min(a__				)
          q.remove(a__				)
          for v in u.neighbors:
               if (v in q) and (u.edges[v.id] < v.key):
                    __magic_name__							:	Dict    							=							u
                    __magic_name__							:	Optional[int]    							=							u.edges[v.id]
     for i in range(1							,len(a__				)				):
          a.append((int(graph[i].id				) + 1, int(graph[i].pi.id				) + 1)				)
     return a







def 		lowercase__   (		__A:	List[Any]							,__A:	Optional[int]				):





     '''simple docstring'''






     for u in graph:
          __magic_name__							:	str    							=							math.inf
          __magic_name__							:	List[str]    							=							None
     __magic_name__							:	Tuple    							=							0

     __magic_name__							:	Optional[int]    							=							list(a__				)
     hq.heapify(a__				)

     while h:
          __magic_name__							:	Optional[Any]    							=							hq.heappop(a__				)
          for v in u.neighbors:
               if (v in h) and (u.edges[v.id] < v.key):
                    __magic_name__							:	int    							=							u
                    __magic_name__							:	Tuple    							=							u.edges[v.id]
                    hq.heapify(a__				)

     for i in range(1							,len(a__				)				):
          yield (int(graph[i].id				) + 1, int(graph[i].pi.id				) + 1)







def 		lowercase__   (		):





     '''simple docstring'''









if __name__ == "__main__":
 import doctest

 doctest.testmod()









import sys
import turtle







def 		lowercase__   (		__A:	tuple[float, float]							,__A:	tuple[float, float]				):





					'''simple docstring'''






					return (pa[0] + pa[0]) / 2, (pa[1] + pa[1]) / 2







def 		lowercase__   (		__A:	tuple[float, float]							,__A:	tuple[float, float]							,__A:	tuple[float, float]							,__A:	int							,):





					'''simple docstring'''






					my_pen.up()
					my_pen.goto(vertexa[0]							,vertexa[1]				)
					my_pen.down()
					my_pen.goto(vertexa[0]							,vertexa[1]				)
					my_pen.goto(vertexa[0]							,vertexa[1]				)
					my_pen.goto(vertexa[0]							,vertexa[1]				)

					if depth == 0:
										return

					triangle(__A							,get_mid(__A							,__A				)							,get_mid(__A							,__A				)							,depth - 1				)
					triangle(__A							,get_mid(__A							,__A				)							,get_mid(__A							,__A				)							,depth - 1				)
					triangle(__A							,get_mid(__A							,__A				)							,get_mid(__A							,__A				)							,depth - 1				)


if __name__ == "__main__":
	if len(sys.argv) != 2:
		raise ValueError(
		    '''Correct format for using this script: '''
		    '''python fractals.py <int:depth_for_fractal>'''
		)
	__lowerCamelCase   :						Any				=			turtle.Turtle()
	my_pen.ht()
	my_pen.speed(5)
	my_pen.pencolor('''red''')

	__lowerCamelCase   :						Optional[Any]				=			[(-1_75, -1_25), (0, 1_75), (1_75, -1_25)]  # vertices of triangle
	triangle(vertices[0], vertices[1], vertices[2], int(sys.argv[1]))



