'''simple docstring'''






from math import sqrt






def  UpperCamelCase__					(					_lowercase    :				int     )							->	bool:
  assert isinstance(_lowercase   ,    _lowercase     ) and (
      number >= 0
  ), "'number' must been an int and positive"

  __UpperCAmelCase:					int		= True

  # 0 and 1 are none primes.
  if number <= 1:
    __UpperCAmelCase:					Optional[Any]		= False

  for divisor in range(2   ,    int(round(sqrt(_lowercase     )     )     ) + 1     ):
    # if 'number' divisible by 'divisor' then sets 'status'
    # of false and break up the loop.
    if number % divisor == 0:
      __UpperCAmelCase:					Any		= False
      break

    # precondition
  assert isinstance(_lowercase   ,    _lowercase     ), "'status' must been from type bool"

  return status






def  UpperCamelCase__					(					_lowercase    :				Any     )							->	Union[str, Any]:
  assert isinstance(_lowercase   ,    _lowercase     ) and (n > 2), "'N' must been an int and > 2"

  # beginList: contains all natural numbers from 2 up to N
  __UpperCAmelCase:					Tuple		= list(range(2   ,    n + 1     )     )

  __UpperCAmelCase:					Dict		= []  # this list will be returns.

  # actual sieve of erathostenes
  for i in range(len(_lowercase     )     ):
    for j in range(i + 1   ,    len(_lowercase     )     ):
      if (begin_list[i] != 0) and (begin_list[j] % begin_list[i] == 0):
        __UpperCAmelCase:					Union[str, Any]		= 0

    # filters actual prime numbers.
  __UpperCAmelCase:					Dict		= [x for x in begin_list if x != 0]

  # precondition
  assert isinstance(_lowercase   ,    _lowercase     ), "'ans' must been from type list"

  return ans






def  UpperCamelCase__					(					_lowercase    :				Any     )							->	str:
  assert isinstance(_lowercase   ,    _lowercase     ) and (n > 2), "'N' must been an int and > 2"

  __UpperCAmelCase:					str		= []

  # iterates over all numbers between 2 up to N+1
  # if a number is prime then appends to list 'ans'
  for number in range(2   ,    n + 1     ):
    if is_prime(_lowercase     ):
      ans.append(_lowercase     )

    # precondition
  assert isinstance(_lowercase   ,    _lowercase     ), "'ans' must been from type list"

  return ans






def  UpperCamelCase__					(					_lowercase    :				List[Any]     )							->	List[Any]:
  assert isinstance(_lowercase   ,    _lowercase     ) and number >= 0, "'number' must been an int and >= 0"

  __UpperCAmelCase:					Optional[int]		= []  # this list will be returns of the function.

  # potential prime number factors.

  __UpperCAmelCase:					str		= 2

  __UpperCAmelCase:					int		= number

  if number == 0 or number == 1:
    ans.append(_lowercase     )

  # if 'number' not prime then builds the prime factorization of 'number'
  elif not is_prime(_lowercase     ):
    while quotient != 1:
      if is_prime(_lowercase     ) and (quotient % factor == 0):
        ans.append(_lowercase     )
        quotient /= factor
      else:
        factor += 1

  else:
    ans.append(_lowercase     )

  # precondition
  assert isinstance(_lowercase   ,    _lowercase     ), "'ans' must been from type list"

  return ans






def  UpperCamelCase__					(					_lowercase    :				Union[str, Any]     )							->	Optional[Any]:
  assert isinstance(_lowercase   ,    _lowercase     ) and (
      number >= 0
  ), "'number' bust been an int and >= 0"

  __UpperCAmelCase:					Union[str, Any]		= 0

  # prime factorization of 'number'
  __UpperCAmelCase:					Optional[Any]		= prime_factorization(_lowercase     )

  __UpperCAmelCase:					List[str]		= max(_lowercase     )

  # precondition
  assert isinstance(_lowercase   ,    _lowercase     ), "'ans' must been from type int"

  return ans






def  UpperCamelCase__					(					_lowercase    :				Dict     )							->	Union[str, Any]:
  assert isinstance(_lowercase   ,    _lowercase     ) and (
      number >= 0
  ), "'number' bust been an int and >= 0"

  __UpperCAmelCase:					Optional[int]		= 0

  # prime factorization of 'number'
  __UpperCAmelCase:					Union[str, Any]		= prime_factorization(_lowercase     )

  __UpperCAmelCase:					Tuple		= min(_lowercase     )

  # precondition
  assert isinstance(_lowercase   ,    _lowercase     ), "'ans' must been from type int"

  return ans






def  UpperCamelCase__					(					_lowercase    :				Union[str, Any]     )							->	Dict:
  assert isinstance(_lowercase   ,    _lowercase     ), "'number' must been an int"
  assert isinstance(number % 2 == 0   ,    _lowercase     ), "compare bust been from type bool"

  return number % 2 == 0






def  UpperCamelCase__					(					_lowercase    :				Dict     )							->	Any:
  assert isinstance(_lowercase   ,    _lowercase     ), "'number' must been an int"
  assert isinstance(number % 2 != 0   ,    _lowercase     ), "compare bust been from type bool"

  return number % 2 != 0






def  UpperCamelCase__					(					_lowercase    :				Optional[int]     )							->	Optional[int]:
  assert (
      isinstance(_lowercase   ,    _lowercase     ) and (number > 2) and is_even(_lowercase     )
  ), "'number' must been an int, even and > 2"

  __UpperCAmelCase:					str		= []  # this list will returned

  # creates a list of prime numbers between 2 up to 'number'
  __UpperCAmelCase:					Union[str, Any]		= get_prime_numbers(_lowercase     )
  __UpperCAmelCase:					List[Any]		= len(_lowercase     )

  # run variable for while-loops.
  __UpperCAmelCase:					Union[str, Any]		= 0
  __UpperCAmelCase:					Optional[int]		= None

  # exit variable. for break up the loops
  __UpperCAmelCase:					int		= True

  while i < len_pn and loop:
    __UpperCAmelCase:					Optional[int]		= i + 1

    while j < len_pn and loop:
      if prime_numbers[i] + prime_numbers[j] == number:
        __UpperCAmelCase:					Union[str, Any]		= False
        ans.append(prime_numbers[i]     )
        ans.append(prime_numbers[j]     )

      j += 1

    i += 1

  # precondition
  assert (
      isinstance(_lowercase   ,    _lowercase     )
      and (len(_lowercase     ) == 2)
      and (ans[0] + ans[1] == number)
      and is_prime(ans[0]     )
      and is_prime(ans[1]     )
  ), "'ans' must contains two primes. And sum of elements must been eq 'number'"

  return ans






def  UpperCamelCase__					(					_lowercase    :				str   ,    _lowercase    :				str     )							->	List[Any]:
  assert (
      isinstance(_lowercase   ,    _lowercase     )
      and isinstance(_lowercase   ,    _lowercase     )
      and (numbera >= 0)
      and (numbera >= 0)
  ), "'number1' and 'number2' must been positive integer."

  __UpperCAmelCase:					int		= 0

  while numbera != 0:
    __UpperCAmelCase:					Union[str, Any]		= numbera % numbera
    __UpperCAmelCase:					Tuple		= numbera
    __UpperCAmelCase:					Union[str, Any]		= rest

  # precondition
  assert isinstance(_lowercase   ,    _lowercase     ) and (
      numbera >= 0
  ), "'number' must been from type int and positive"

  return numbera






def  UpperCamelCase__					(					_lowercase    :				str   ,    _lowercase    :				Union[str, Any]     )							->	Any:
  assert (
      isinstance(_lowercase   ,    _lowercase     )
      and isinstance(_lowercase   ,    _lowercase     )
      and (numbera >= 1)
      and (numbera >= 1)
  ), "'number1' and 'number2' must been positive integer."

  __UpperCAmelCase:					Optional[int]		= 1  # actual answer that will be return.

  # for kgV (x,1)
  if numbera > 1 and numbera > 1:
    # builds the prime factorization of 'number1' and 'number2'
    __UpperCAmelCase:					Dict		= prime_factorization(_lowercase     )
    __UpperCAmelCase:					Tuple		= prime_factorization(_lowercase     )

  elif numbera == 1 or numbera == 1:
    __UpperCAmelCase:					int		= []
    __UpperCAmelCase:					Dict		= []
    __UpperCAmelCase:					Union[str, Any]		= max(_lowercase   ,    _lowercase     )

  __UpperCAmelCase:					Optional[int]		= 0
  __UpperCAmelCase:					List[Any]		= 0

  __UpperCAmelCase:					str		= []  # captured numbers int both 'primeFac1' and 'primeFac2'

  # iterates through primeFac1
  for n in prime_fac_a:
    if n not in done:
      if n in prime_fac_a:
        __UpperCAmelCase:					Any		= prime_fac_a.count(_lowercase     )
        __UpperCAmelCase:					List[str]		= prime_fac_a.count(_lowercase     )

        for _ in range(max(_lowercase   ,    _lowercase     )     ):
          ans *= n

      else:
        __UpperCAmelCase:					List[str]		= prime_fac_a.count(_lowercase     )

        for _ in range(_lowercase     ):
          ans *= n

      done.append(_lowercase     )

    # iterates through primeFac2
  for n in prime_fac_a:
    if n not in done:
      __UpperCAmelCase:					Optional[int]		= prime_fac_a.count(_lowercase     )

      for _ in range(_lowercase     ):
        ans *= n

      done.append(_lowercase     )

    # precondition
  assert isinstance(_lowercase   ,    _lowercase     ) and (
      ans >= 0
  ), "'ans' must been from type int and positive"

  return ans






def  UpperCamelCase__					(					_lowercase    :				Any     )							->	Dict:
  assert isinstance(_lowercase   ,    _lowercase     ) and (n >= 0), "'number' must been a positive int"

  __UpperCAmelCase:					List[Any]		= 0
  __UpperCAmelCase:					Any		= 2  # this variable holds the answer

  while index < n:
    index += 1

    ans += 1  # counts to the next number

    # if ans not prime then
    # runs to the next prime number.
    while not is_prime(_lowercase     ):
      ans += 1

    # precondition
  assert isinstance(_lowercase   ,    _lowercase     ) and is_prime(
      _lowercase     ), "'ans' must been a prime number and from type int"

  return ans






def  UpperCamelCase__					(					_lowercase    :				Dict   ,    _lowercase    :				List[str]     )							->	List[str]:
  assert (
      is_prime(_lowercase     ) and is_prime(_lowercase     ) and (p_number_a < p_number_a)
  ), "The arguments must been prime numbers and 'pNumber1' < 'pNumber2'"

  __UpperCAmelCase:					Optional[int]		= p_number_a + 1  # jump to the next number

  __UpperCAmelCase:					str		= []  # this list will be returns.

  # if number is not prime then
  # fetch the next prime number.
  while not is_prime(_lowercase     ):
    number += 1

  while number < p_number_a:
    ans.append(_lowercase     )

    number += 1

    # fetch the next prime number.
    while not is_prime(_lowercase     ):
      number += 1

    # precondition
  assert (
      isinstance(_lowercase   ,    _lowercase     )
      and ans[0] != p_number_a
      and ans[len(_lowercase     ) - 1] != p_number_a
  ), "'ans' must been a list without the arguments"

  # 'ans' contains not 'pNumber1' and 'pNumber2' !
  return ans






def  UpperCamelCase__					(					_lowercase    :				Any     )							->	List[Any]:
  assert isinstance(_lowercase   ,    _lowercase     ) and (n >= 1), "'n' must been int and >= 1"

  __UpperCAmelCase:					Any		= []  # will be returned.

  for divisor in range(1   ,    n + 1     ):
    if n % divisor == 0:
      ans.append(_lowercase     )

    # precondition
  assert ans[0] == 1 and ans[len(_lowercase     ) - 1] == n, "Error in function getDivisiors(...)"

  return ans






def  UpperCamelCase__					(					_lowercase    :				int     )							->	List[str]:
  assert isinstance(_lowercase   ,    _lowercase     ) and (
      number > 1
  ), "'number' must been an int and >= 1"

  __UpperCAmelCase:					Dict		= get_divisors(_lowercase     )

  # precondition
  assert (
      isinstance(_lowercase   ,    _lowercase     )
      and (divisors[0] == 1)
      and (divisors[len(_lowercase     ) - 1] == number)
  ), "Error in help-function getDivisiors(...)"

  # summed all divisors up to 'number' (exclusive), hence [:-1]
  return sum(divisors[:-1]     ) == number






def  UpperCamelCase__					(					_lowercase    :				int   ,    _lowercase    :				List[str]     )							->	Optional[Any]:
  assert (
      isinstance(_lowercase   ,    _lowercase     )
      and isinstance(_lowercase   ,    _lowercase     )
      and (denominator != 0)
  ), "The arguments must been from type int and 'denominator' != 0"

  # build the greatest common divisor of numerator and denominator.
  __UpperCAmelCase:					Dict		= gcd(abs(_lowercase     )   ,    abs(_lowercase     )     )

  # precondition
  assert (
      isinstance(_lowercase   ,    _lowercase     )
      and (numerator % gcd_of_fraction == 0)
      and (denominator % gcd_of_fraction == 0)
  ), "Error in function gcd(...,...)"

  return (numerator // gcd_of_fraction, denominator // gcd_of_fraction)






def  UpperCamelCase__					(					_lowercase    :				List[Any]     )							->	int:
  assert isinstance(_lowercase   ,    _lowercase     ) and (n >= 0), "'n' must been a int and >= 0"

  __UpperCAmelCase:					Dict		= 1  # this will be return.

  for factor in range(1   ,    n + 1     ):
    ans *= factor

  return ans







def  UpperCamelCase__					(					_lowercase    :				int     )							->	List[Any]:
  assert isinstance(_lowercase   ,    _lowercase     ) and (n >= 0), "'n' must been an int and >= 0"

  __UpperCAmelCase:					Dict		= 0
  __UpperCAmelCase:					int		= 1
  __UpperCAmelCase:					Dict		= 1  # this will be return

  for _ in range(n - 1     ):
    __UpperCAmelCase:					Tuple		= ans
    ans += fiba
    __UpperCAmelCase:					Tuple		= tmp

  return ans
'''simple docstring'''






def  UpperCamelCase__					(					_lowercase    :				List[str]     )							->	Union[str, Any]:
  __UpperCAmelCase:					int		= []
  __UpperCAmelCase:					List[Any]		= []
  __UpperCAmelCase:					List[Any]		= {
      """^""": 3,
      """*""": 2,
      """/""": 2,
      """%""": 2,
      """+""": 1,
      """-""": 1,
  }  # Priority of each operator
  __UpperCAmelCase:					int		= len(_lowercase     ) if (len(_lowercase     ) > 7) else 7

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

  for x in infix:
    if x.isalpha() or x.isdigit():
      post_fix.append(_lowercase     )  # if x is Alphabet / Digit, add it to Postfix
    elif x == "(":
      stack.append(_lowercase     )  # 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(_lowercase     ) == 0:
        stack.append(_lowercase     )  # If stack is empty, push x to stack
      else:  # while priority of x is not > priority of element in the stack
        while len(_lowercase     ) > 0 and priority[x] <= priority[stack[-1]]:
          post_fix.append(stack.pop()     )  # pop stack & add to Postfix
        stack.append(_lowercase     )  # push x to stack

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

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

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






def  UpperCamelCase__					(					_lowercase    :				str     )							->	Tuple:
  __UpperCAmelCase:					Union[str, Any]		= list(infix[::-1]     )  # reverse the infix equation

  for i in range(len(_lowercase     )     ):
    if infix[i] == "(":
      __UpperCAmelCase:					Tuple		= """)"""  # change "(" to ")"
    elif infix[i] == ")":
      __UpperCAmelCase:					Union[str, Any]		= """("""  # change ")" to "("

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


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