"""simple docstring"""


import baseaa






def 			__UpperCAmelCase    (	lowercase						):







  """simple docstring"""
  return baseaa.aaaencode(string.encode("""utf-8"""						)						)






def 			__UpperCAmelCase    (	lowercase						):







  """simple docstring"""
  return baseaa.aaadecode(lowercase						).decode("""utf-8"""						)


if __name__ == "__main__":
    import doctest

    doctest.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()
