

"""simple docstring"""

from __future__ import annotations

from collections.abc import Iterator
from typing import Any






class  __a				:





       """simple docstring"""


       def __init__(      self ,				snake_case      ):





        """simple docstring"""

        lowerCAmelCase__      :							Any    =							data
        lowerCAmelCase__      :							Node | None    =							None






       def __str__(      self      ):





        """simple docstring"""

        return F"""{self.data}"""






class  __a				:





       """simple docstring"""


       def __init__(      self      ):





        """simple docstring"""

        lowerCAmelCase__      :							Node | None    =							None
        lowerCAmelCase__      :							Node | None    =							None






       def __iter__(      self      ):





        """simple docstring"""

        lowerCAmelCase__      :							Optional[Any]    =							self.front
        while node:
         yield node.data
         lowerCAmelCase__      :							str    =							node.next






       def __len__(      self      ):





        """simple docstring"""

        return len(tuple(iter(self      )      )      )






       def __str__(      self      ):





        """simple docstring"""

        return " <- ".join(str(snake_case      ) for item in self      )






       def  SCREAMING_SNAKE_CASE_  (      self      ):





        """simple docstring"""

        return len(self      ) == 0






       def  SCREAMING_SNAKE_CASE_  (      self ,				snake_case      ):





        """simple docstring"""

        lowerCAmelCase__      :							List[str]    =							Node(snake_case      )
        if self.is_empty():
         lowerCAmelCase__      :							str    =							node
        else:
         assert isinstance(self.rear ,				snake_case      )
         lowerCAmelCase__      :							Dict    =							node
         lowerCAmelCase__      :							List[Any]    =							node






       def  SCREAMING_SNAKE_CASE_  (      self      ):





        """simple docstring"""

        if self.is_empty():
         raise IndexError("dequeue from empty queue"      )
        assert isinstance(self.front ,				snake_case      )
        lowerCAmelCase__      :							Tuple    =							self.front
        lowerCAmelCase__      :							Optional[int]    =							self.front.next
        if self.front is None:
         lowerCAmelCase__      :							Optional[int]    =							None
        return node.data






       def  SCREAMING_SNAKE_CASE_  (      self      ):





        """simple docstring"""

        lowerCAmelCase__      :							str    =							None


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

    testmod()









"""simple docstring"""

from itertools import product



def 			SCREAMING_SNAKE_CASE       (   lowercase__ = 1_5      ) ->	int:
 lowerCAmelCase__      :							float    =							0.0
 lowerCAmelCase__      :							float
 lowerCAmelCase__      :							int
 lowerCAmelCase__      :							int
 lowerCAmelCase__      :							int
 lowerCAmelCase__      :							int
 lowerCAmelCase__      :							tuple[int, ...]

 for series in product(range(2      )				,				repeat=lowercase__      ):
  lowerCAmelCase__      :							Optional[int]    =							series.count(1      )
  lowerCAmelCase__      :							Dict    =							num_turns - num_blue
  if num_red >= num_blue:
   continue
  lowerCAmelCase__      :							Dict    =							1.0
  for ind, col in enumerate(lowercase__				,				2      ):
   if col == 0:
    prob *= (ind - 1) / ind
   else:
    prob *= 1 / ind

  total_prob += prob

 return int(1 / total_prob      )


if __name__ == "__main__":
    print(f"{solution() = }")






