(a+b+c)^3
=(a+b)^3+3(a+b)^2c+3(a+b)c^2+c^3
=a^3+3a^2b+3ab^2+b^3+3(a^2+2ab+b^2)c+3(a+b)c^2+c^3
=a^3+b^3+c^3+3a^2c+6abc+3b^2c+3ac^2+3bc^2
=a^3+b^3+c^3+(3a^2c+3abc)+(3abc+3b^2c)+(3ac^2+3bc^2)
=a^3+b^3+c^3+3ac(a+b)+3bc(a+b)+3c^2(a+b)
=a^3+b^3+c^3+3(a+b)(ac+bc+c^2)
=a^3+b^3+c^3+3(a+b)[(ac+bc)+c^2]
=a^3+b^3+c^3+3(a+b)c(a+b+c)