M = (a + b + c)3 - a3 - b3 - c3
= (a + b)3 + c3 + 3(a + b)2c + 3(a + b)c2 - a3 - b3 - c3
= a3 + b3 + c3 + 3a2b + 3ab2 + 3(a + b)c(a + b + c) - a3 - b3 - c3
= 3ab (a + b) + 3c(a + b)(a + b + c)
= 3(a + b)[ab + c(a + b + c)]
= 3(a + b)(ab + bc + ac + c2)
= 3(a + b)[b(a + c) + c(a + c)]
= 3(a + b)(b + c)(c + a)
N = a3 + b3 + c3 - 3abc
= (a + b)3 + c3 - 3ab(a + b) - 3abc
= (a + b + c)3 - 3(a + b)c(a + b + c) - 3ab(a + b + c)
= (a + b + c)[(a + b + c)2 - 3(a + b)c - 3ab]
= (a + b + c)(a2 + b2 + c2 + 2ab + 2bc + 2ca - 2ac - 3bc - 3ab)
= (a + b + c)(a2 + b2 + c2 - ab - bc - ca)