If all letters are same, then number of ways
=Coefficient of `x^(6)` in `(.^(3)C_(1)x+.^(3)C_(2)x^(2)+.^(3)C_(3)x^(3))^(3)(.^(1)C_(1)x)^(2)`
=Coeficient of x in `(3+3x+x^(2))^(3)`
=Coefficient of x in `(3+3x)^(3)` [neglecting higher degree term]
`=27xx.^(3)C_1=81`
But inn DIPESH all letters are different.
`therefore`Required number of ways`=81xx6!`