A = float(input())
B = float(input())
C = float(input())

nota = ((A*2)+(B*3)+(C*5))/10

print(f"MEDIA = {nota:.1f}")
A = float(input())
B = float(input())
C = float(input())

nota = ((A*2)+(B*3)+(C*5))/10

print(f"MEDIA = {nota:.1f}")