
def    lowerCamelCase__				(				__lowerCAmelCase  :  Optional[int]				):




			"""simple docstring"""


			lowerCAmelCase_						=	[]
			lowerCAmelCase_						=	[]
			lowerCAmelCase_						=	{
			    "^": 3,
			    "*": 2,
			    "/": 2,
			    "%": 2,
			    "+": 1,
			    "-": 1,
			}  # Priority of each operator
			lowerCAmelCase_						=	len(__lowerCAmelCase				) if (len(__lowerCAmelCase				) > 7) else 7

			# Print table header for output
			print(
			    "Symbol".center(8				)    ,							"Stack".center(__lowerCAmelCase				)    ,							"Postfix".center(__lowerCAmelCase				)    ,							sep=" | "    ,							)
			print("-" * (print_width * 3 + 7)				)

			for x in infix:
						if x.isalpha() or x.isdigit():
									post_fix.append(__lowerCAmelCase				)  # if x is Alphabet / Digit, add it to Postfix
						elif x == "(":
									stack.append(__lowerCAmelCase				)  # if x is "(" push to Stack
						elif x == ")":  # if x is ")" pop stack until "(" is encountered
									while stack[-1] != "(":
												post_fix.append(stack.pop()				)  # Pop stack & add the content to Postfix
									stack.pop()
						else:
									if len(__lowerCAmelCase				) == 0:
												stack.append(__lowerCAmelCase				)  # If stack is empty, push x to stack
									else:  # while priority of x is not > priority of element in the stack
												while len(__lowerCAmelCase				) > 0 and priority[x] <= priority[stack[-1]]:
															post_fix.append(stack.pop()				)  # pop stack & add to Postfix
												stack.append(__lowerCAmelCase				)  # push x to stack

						print(
						    x.center(8				)    ,							("".join(__lowerCAmelCase				)).ljust(__lowerCAmelCase				)    ,							("".join(__lowerCAmelCase				)).ljust(__lowerCAmelCase				)    ,							sep=" | "    ,							)  # Output in tabular format

			while len(__lowerCAmelCase				) > 0:  # while stack is not empty
						post_fix.append(stack.pop()				)  # pop stack & add to Postfix
						print(
						    " ".center(8				)    ,							("".join(__lowerCAmelCase				)).ljust(__lowerCAmelCase				)    ,							("".join(__lowerCAmelCase				)).ljust(__lowerCAmelCase				)    ,							sep=" | "    ,							)  # Output in tabular format

			return "".join(__lowerCAmelCase				)  # return Postfix as str






def    lowerCamelCase__				(				__lowerCAmelCase  :  Union[str, Any]				):




			"""simple docstring"""


			lowerCAmelCase_						=	list(infix[::-1]				)  # reverse the infix equation

			for i in range(len(__lowerCAmelCase				)				):
						if infix[i] == "(":
									lowerCAmelCase_						=	")"  # change "(" to ")"
						elif infix[i] == ")":
									lowerCAmelCase_						=	"("  # change ")" to "("

			return (infix_2_postfix("".join(__lowerCAmelCase				)				))[
			    ::-1
			]  # call infix_2_postfix on Infix, return reverse of Postfix


if __name__ == "__main__":
			_A   =     input("\nEnter an Infix Equation = ")  # Input an Infix equation
			_A   =     "".join(Infix.split())  # Remove spaces from the input
			print("\n\t", Infix, "(Infix) -> ", infix_2_prefix(Infix), "(Prefix)")





import math






def    lowerCamelCase__				(				__lowerCAmelCase  :  int				):




			"""simple docstring"""


			lowerCAmelCase_						=	0
			lowerCAmelCase_						=	0
			while num > 0:
						lowerCAmelCase_						=	num % 8
						lowerCAmelCase_						=	octal + (remainder * math.floor(math.pow(10    ,							__lowerCAmelCase				)				))
						counter += 1
						lowerCAmelCase_						=	math.floor(num / 8				)  # basically /= 8 without remainder if any
						# This formatting removes trailing '.0' from `octal`.
			return F"""0o{int(__lowerCAmelCase				)}"""






def    lowerCamelCase__				(				):




			"""simple docstring"""


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



