How to subscribe "/scan" topic, modify message Laserscan.ranges and publish it again to "/scan" topic?

Thank you very much sir. If you do not mind, can you help me answer this question also and it is related to this question. How to subscribe "/scan" topic, modify message Laserscan.ranges and publish it to the new topic?