






'''simple docstring'''
import math




def 		__SCREAMING_SNAKE_CASE					(  _UpperCamelCase							):


   """simple docstring"""




   lowercase_	:    List[Any]           =						[]
   lowercase_	:    Any           =						2
   lowercase_	:    List[str]           =						int(math.sqrt(UpperCAmelCase__							)							)  # Size of every segment
   lowercase_	:    int           =						[True] * (end + 1)
   lowercase_	:    Dict           =						[]

   while start <= end:
      if temp[start] is True:
         in_prime.append(UpperCAmelCase__							)
         for i in range(start * start						,		end + 1						,		UpperCAmelCase__							):
            lowercase_	:    Optional[int]           =						False
      start += 1
   prime += in_prime

   lowercase_	:    str           =						end + 1
   lowercase_	:    Any           =						min(2 * end						,		UpperCAmelCase__							)

   while low <= n:
      lowercase_	:    int           =						[True] * (high - low + 1)
      for each in in_prime:
         lowercase_	:    Union[str, Any]           =						math.floor(low / each							) * each
         if t < low:
            t += each

         for j in range(UpperCAmelCase__						,		high + 1						,		UpperCAmelCase__							):
            lowercase_	:    List[Any]           =						False

      for j in range(len(UpperCAmelCase__							)							):
         if temp[j] is True:
            prime.append(j + low							)

      lowercase_	:    int           =						high + 1
      lowercase_	:    Optional[Any]           =						min(high + end						,		UpperCAmelCase__							)

   return prime





print(sieve(10**6))












'''simple docstring'''
def 		__SCREAMING_SNAKE_CASE					(  _UpperCamelCase							):


   """simple docstring"""




   return [
       {
           0: [1, 2],
           1: [0, 2],
           2: [0, 1, 3, 5],
           3: [2, 4],
           4: [3],
           5: [2, 6, 8],
           6: [5, 7],
           7: [6, 8],
           8: [5, 7],
       },
       {
           0: [6],
           1: [9],
           2: [4, 5],
           3: [4],
           4: [2, 3],
           5: [2],
           6: [0, 7],
           7: [6],
           8: [],
           9: [1],
       },
       {
           0: [4],
           1: [6],
           2: [],
           3: [5, 6, 7],
           4: [0, 6],
           5: [3, 8, 9],
           6: [1, 3, 4, 7],
           7: [3, 6, 8, 9],
           8: [5, 7],
           9: [5, 7],
       },
       {
           0: [1, 3],
           1: [0, 2, 4],
           2: [1, 3, 4],
           3: [0, 2, 4],
           4: [1, 2, 3],
       },
   ][index]




def 		__SCREAMING_SNAKE_CASE					(  _UpperCamelCase							):


   """simple docstring"""




   lowercase_	:    Dict           =     0
   lowercase_	:    Optional[Any]           =     len(_UpperCamelCase							)  # No of vertices in graph
   lowercase_	:    Union[str, Any]           =     [0] * n
   lowercase_	:    Optional[int]           =     [False] * n

   def dfs(_UpperCamelCase						,		_UpperCamelCase						,		_UpperCamelCase						,		_UpperCamelCase							):
      lowercase_	:    Union[str, Any]           =     True
      lowercase_	:    Dict           =     id_
      id_ += 1
      for to in graph[at]:
         if to == parent:
            pass
         elif not visited[to]:
            dfs(_UpperCamelCase						,		_UpperCamelCase						,		_UpperCamelCase						,		id_							)
            lowercase_	:    str           =     min(low[at]						,		low[to]							)
            if id_ <= low[to]:
               bridges.append((at, to) if at < to else (to, at)							)
         else:
            # This edge is a back edge and cannot be a bridge
            lowercase_	:    Optional[int]           =     min(low[at]						,		low[to]							)

   lowercase_	:    list[tuple[int, int]]           =     []
   for i in range(_UpperCamelCase							):
      if not visited[i]:
         dfs(_UpperCamelCase						,		-1						,		_UpperCamelCase						,		id_							)
   return bridges


if __name__ == "__main__":
 import doctest

 doctest.testmod()




