When R and W are the first and last letters of all the words then we can arrange them in 5!ways. Similarly When W and R are the first and last letters of the words then the remaining letters can be arrange in 5! ways.
Thus the total number of permutations = 2 x 5! = 2 x 120 = 240