import numpy as np M_NaCl=1.7475645946 M_CsCl=1.7626747730 a000,a001,a010,a011,a100,a101,a110,a111=list(map(float,input().split())) b111,b113,b131,b133,b311,b313,b331,b333=list(map(float,input().split())) print(-(M_NaCl*(a011+a101+a110-a001-a010-a100)/3+M_CsCl*(3*a000+a001+a010+a100)/np.sqrt(3)/3*2))