Let x = shirts, y = trousers, z = hats
Forming Equation 1
4x+4y+2z = 560
Simplifying it to,
2x + 2y + z = 280
Forming Equation 2
9x + 9y + 6z = 1290
Simpifying it to,
3x + 3y + 2z = 430
(1) 2x + 2y + z = 280
(2) 3x + 3y + 2z = 430
Doing (2) - (1)
3x + 3y + 2z = 430
2x + 2y + z = 280
Answer is
x + y + z = 150