

import math
def      _lowerCAmelCase(	__A     :   int			):
  UpperCAmelCase					      =  0
  UpperCAmelCase					      =  0
  while num > 0:
    UpperCAmelCase					      =  num % 8
    UpperCAmelCase					      =  octal + (remainder * math.floor(math.pow(10   ,       _lowercase			)			))
    counter += 1
    UpperCAmelCase					      =  math.floor(num / 8			)  # basically /= 8 without remainder if any
    # This formatting removes trailing '.0' from `octal`.
  return F"0o{int(_lowercase			)}"
def      _lowerCAmelCase(	):
  print("\n2 in octal is:"			)
  print(decimal_to_octal(2			)			)  # = 2
  print("\n8 in octal is:"			)
  print(decimal_to_octal(8			)			)  # = 10
  print("\n65 in octal is:"			)
  print(decimal_to_octal(65			)			)  # = 101
  print("\n216 in octal is:"			)
  print(decimal_to_octal(216			)			)  # = 330
  print("\n512 in octal is:"			)
  print(decimal_to_octal(512			)			)  # = 1000
  print("\n"			)


if __name__ == "__main__":
      main()






lowerCAmelCase__       = {
    "a": "AAAAA",
    "b": "AAAAB",
    "c": "AAABA",
    "d": "AAABB",
    "e": "AABAA",
    "f": "AABAB",
    "g": "AABBA",
    "h": "AABBB",
    "i": "ABAAA",
    "j": "BBBAA",
    "k": "ABAAB",
    "l": "ABABA",
    "m": "ABABB",
    "n": "ABBAA",
    "o": "ABBAB",
    "p": "ABBBA",
    "q": "ABBBB",
    "r": "BAAAA",
    "s": "BAAAB",
    "t": "BAABA",
    "u": "BAABB",
    "v": "BBBAB",
    "w": "BABAA",
    "x": "BABAB",
    "y": "BABBA",
    "z": "BABBB",
    " ": " ",
}


lowerCAmelCase__       = {value: key for key, value in encode_dict.items()}
def      _lowerCAmelCase(	__A			):
  UpperCAmelCase					      =  ""
  for letter in word.lower():
    if letter.isalpha() or letter == " ":
      encoded += encode_dict[letter]
    else:
      raise Exception("encode() accepts only letters of the alphabet and spaces"			)
  return encoded
def      _lowerCAmelCase(	__A			):
  if set(__A			) - {"A", "B", " "} != set():
    raise Exception("decode() accepts only 'A', 'B' and spaces"			)
  UpperCAmelCase					      =  ""
  for word in coded.split():
    while len(__A			) != 0:
      decoded += decode_dict[word[:5]]
      UpperCAmelCase					      =  word[5:]
    decoded += " "
  return decoded.strip()


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

      testmod()



