>>168
これでいいのでしょうか?

https://ideone.com/bLfLVt