More of my thinking before I thought it was a trick question ...
The mass of steam = the mass of the water once it's completely condensed, so I started by looking for steam tables that would tell me this. If I could find the density of steam at given pressure and temperature I could work out the mass from the volume of the pipe. Trouble is, steam doesn't appear to exist at this temp and pressure.
Then I got to thinking, given the gas law ([p1v1]/t1 = [p2v2]/t2), you can work out pressure and temperature for a constant volume. So if you start at 8 bar and 145 degrees, and finish at 0 bar and 25 degrees, the gas law should agree. But maybe this gas law only works for one phase and doesn't take into account condensation. Maybe the t can only be sensible, or else the equation doesn't work.
I try to picture a pipe with 8 bar steam in it at 145 degrees C ( which isn't THAT hot ), then cool it to room temperature and open the pipe only to find the contents at atmospheric... must be a trick question....