def solve_arithmetic_phrase(channel, method, properties, body):
    with open('output.txt', 'a') as file:
        try:
            body_str = eval(body)
            result = eval(body_str)
            file.write(f'''{body_str} = {result}
''')
            return result
        except Exception as e:
            print(f'Error while calculating "{body_str}": {str(e)}')
def solve_arithmetic_phrase(channel, method, properties, body):
    with open('output.txt', 'a') as file:
        try:
            body_str = eval(body)
            result = eval(body_str)
            file.write(f'{body_str} = {result}
')
            return result
        except Exception as e:
            print(f'Error while calculating "{body_str}": {str(e)}')