


'''simple docstring'''







from __future__ import annotations

from queue import Queue
class    lowercase_	:


    def __init__(	self       ):
          UpperCamelCase__      =							{}


    def   __a				(	self       ):
          for i in self.vertices:
                print(a    ,   " : "    ,   " -> ".join([str(a       ) for j in self.vertices[i]]       )       )


    def   __a				(	self    ,   a    ,   a       ):
          if from_vertex in self.vertices:
                self.vertices[from_vertex].append(a       )
          else:
                UpperCamelCase__      =							[to_vertex]


    def   __a				(	self    ,   a       ):
          UpperCamelCase__      =							set()

          # create a first in first out queue to store all the vertices for BFS
          UpperCamelCase__      =							Queue()

          # mark the source node as visited and enqueue it
          visited.add(a       )
          queue.put(a       )

          while not queue.empty():
                UpperCamelCase__      =							queue.get()

                # loop through all adjacent vertex and enqueue it if not yet visited
                for adjacent_vertex in self.vertices[vertex]:
                      if adjacent_vertex not in visited:
                            queue.put(a       )
                            visited.add(a       )
          return visited


if __name__ == "__main__":
  from doctest import testmod

  testmod(verbose=True)

  a__    :   Any								=			Graph()
  g.add_edge(0, 1)
  g.add_edge(0, 2)
  g.add_edge(1, 2)
  g.add_edge(2, 0)
  g.add_edge(2, 3)
  g.add_edge(3, 3)

  g.print_graph()
  # 0  :  1 -> 2
  # 1  :  2
  # 2  :  0 -> 3
  # 3  :  3

  assert sorted(g.bfs(2)) == [0, 1, 2, 3]









'''simple docstring'''







import itertools







def _UpperCamelCase			(	__A = 1000000       )				->						int:


      '''simple docstring'''



      UpperCamelCase__      =							[1]

      for i in itertools.count(len(__A       )       ):
            UpperCamelCase__      =							0
            for j in itertools.count(1       ):
                  UpperCamelCase__      =							-1 if j % 2 == 0 else +1
                  UpperCamelCase__      =							(j * j * 3 - j) // 2
                  if index > i:
                        break
                  item += partitions[i - index] * sign
                  item %= number
                  index += j
                  if index > i:
                        break
                  item += partitions[i - index] * sign
                  item %= number

            if item == 0:
                  return i
            partitions.append(__A       )

      return 0


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  print(F"""{solution() = }""")





