start with the first two equations and add them together
4e + 4f + g = 24
2e - 4f + g = 0
add and get 6e + 2g = 24 (set this aside)
add the 1st and 3rd equation
4e + 4f + g = 24
5e - 4f - 5g = 12
add them and get 9e - 4g = 36 (set this aside)
now, take the first equation and multiply it by 2
12e +4g = 48
add this to 9e - 4g = 36 and get
21e = 84 divide both sides by 21 and e = 4
now work backwards to find g and f
9(4) - 4g = 36
36 - 4g = 36
-4g = 0 so g= 0
now find f
4(4) + 4f + 0 = 24
16 + 4f = 24
4f = 8 so f = 2
final answer is e = 4, f= 2 and g = 0