


"""simple docstring"""







from collections.abc import Iterable
from typing import Generic, TypeVar

lowerCAmelCase__      				=   TypeVar('''_T''')


class       SCREAMING_SNAKE_CASE__				(		Generic[_T]				):
       """simple docstring"""


       def __init__(						self		,     snake_case__ = None						):






         """simple docstring"""





         lowerCAmelCase     :     list[_T]								=							list(iterable or []						)
         lowerCAmelCase     :     list[_T]								=							[]

       def __len__(						self						):






         """simple docstring"""





         return len(self._stacka						) + len(self._stacka						)

       def __repr__(						self						):






         """simple docstring"""





         return f"""Queue({tuple(self._stacka[::-1] + self._stacka						)})"""

       def        lowercase__							(						self		,     snake_case__						):






         """simple docstring"""





         self._stacka.append(snake_case__						)







       def        lowercase__							(						self						):






         """simple docstring"""





         lowerCAmelCase     :     Optional[int]								=							self._stacka.pop
         lowerCAmelCase     :     List[str]								=							self._stacka.append

         if not self._stacka:
           while self._stacka:
             stacka_append(stacka_pop()						)

         if not self._stacka:
           raise IndexError("Queue is empty"						)
         return self._stacka.pop()


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

     testmod()






"""simple docstring"""


UpperCAmelCase__     						=  {
    """meter""": """m""",
    """kilometer""": """km""",
    """megametre""": """Mm""",
    """gigametre""": """Gm""",
    """terametre""": """Tm""",
    """petametre""": """Pm""",
    """exametre""": """Em""",
    """zettametre""": """Zm""",
    """yottametre""": """Ym""",
}
# Exponent of the factor(meter)
UpperCAmelCase__     						=  {
    """m""": 0,
    """km""": 3,
    """Mm""": 6,
    """Gm""": 9,
    """Tm""": 1_2,
    """Pm""": 1_5,
    """Em""": 1_8,
    """Zm""": 2_1,
    """Ym""": 2_4,
}






def 			__UpperCAmelCase    (	lowercase      ,lowercase      ,lowercase						):







  """simple docstring"""
  _UpperCAmelCase         =					from_type.lower().strip("""s"""						)
  _UpperCAmelCase         =					to_type.lower().strip("""s"""						)

  _UpperCAmelCase         =					UNIT_SYMBOL.get(lowercase      ,lowercase						)
  _UpperCAmelCase         =					UNIT_SYMBOL.get(lowercase      ,lowercase						)

  if from_sanitized not in METRIC_CONVERSION:
    _UpperCAmelCase         =					(
        f'''Invalid \'from_type\' value: {from_type!r}.\n'''
        f'''Conversion abbreviations are: {", ".join(lowercase						)}'''
    )
    raise ValueError(lowercase						)
  if to_sanitized not in METRIC_CONVERSION:
    _UpperCAmelCase         =					(
        f'''Invalid \'to_type\' value: {to_type!r}.\n'''
        f'''Conversion abbreviations are: {", ".join(lowercase						)}'''
    )
    raise ValueError(lowercase						)
  _UpperCAmelCase         =					METRIC_CONVERSION[from_sanitized]
  _UpperCAmelCase         =					METRIC_CONVERSION[to_sanitized]
  _UpperCAmelCase         =					1

  if from_exponent > to_exponent:
    _UpperCAmelCase         =					from_exponent - to_exponent
  else:
    _UpperCAmelCase         =					-(to_exponent - from_exponent)

  return value * pow(10      ,lowercase						)


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

    testmod()
