#!/usr/bin/env python3 # Fill Input input = "" try: with open("2.txt", 'r', encoding='utf-8') as file: input += file.read() except Exception as e: print(f"An error occurred: {e}") # Result res1 = 0; res2 = 0; for line in input.split('\n'): if line == "": break box = [int(n) for n in line.split('x')] box.sort() l,w,h= box res1+=3*l*w+2*(w*h+l*h) res2+=2*(l+w)+l*w*h print(res1, res2)