SP26181 JC15C - Walking Jumper

Description

**Walking Jumper** ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP26181/8d6d5be559d11690376e19849097f952f7479dca.png) Gunawan really bored today, he sit in his home reading newspaper, but suddently he found very interesting news. Using modern radar, Satria detect a new chemical stone on top of the nearby mountain, the stone is so rare so it will be very valuable. After Gunawan know that news, he decided to climb that mountain to collect some of that valuable stone. To climb the mountain he need energy, to use energy he need oxygen, he know that when climbing the mountain there are some part of the mountain containing sulphuric gas and it's toxic so decreasing his oxygen, fortunately some other montain part containing clear breathable air that increasing his oxygen. Because it's dangerous to climb the mountain without a map containing information about which part of the mountain has breathable air and which part of the mountain containing toxic sulphuric gas, Gunawan went to Tjandra house because Tjandra has that mountain map. Tjandra strongly advise Gunawan to take a deep breath before climbing this mountain to store some oxygen in his body and recommend him to train his jumping power to avoid the toxic gas part (by jumping of course). After a few days of training, Gunawan observed that his optimal jumping power is propotional to the ammount of oxygen inside his body, that means if he has K unit of oxygen inside his body he can jump at most K unit skipping K-1 area that may be containing toxic gas. Not only that, he also obseved that after he jump his leg is shaking for a while so he must walk at some distance, this distance also the same as the distance he jumped, for example after he jump with distance K unit, he must walk K unit before he can make another jump. His last observation is that jumping has no effect with his oxygen inside his body, that means no matter how far he jump the ammount of oxygen in his body remain the same. Tjandra tell Gunawan that he must keep his oxygen level positve, if he run out of oxygen (oxygen level in his body [{4} _-G----+-_]`: Gunawan jump 2 step forward to avoid the first toxic area, now he land on the breathable oxygen area increasing his oxygen level to 4. `[{4} _-G----+-_] =="W"==> [{3} _-.G---+-_]`: Because Gunawan's leg is shaking after jump, he is unable to jump so his only choice is to walk to next area decreasing his oxygen level to 3 because that next area is toxic. `[{3} _-.G---+-_] =="W"==> [{2} _-..G--+-_]`: Similar to his previous move, his only choice is to walk to the next area. `[{2} _-..G--+-_] ="J 2"=> [{1} _-...-G+-_]`: After walking two steps his leg become normal again so he can jump to avoid the next toxic area, but unfortunately his remaining oxygen is only 2 so the best jump he can do is to jump 2 step forward landing on toxic area decreasing his oxygen level to 1. `[{1} _-...-G+-_] =="W"==> [{2} _-...-.G-_]`: Fortunately the next area is breathable area, so he walk to this area increasing his oxygen level to 2. `[{1} _-...-.G-_] =="W"==> [{2} _-...-..G_]`: Because the effect of previous jump is not gone, his leg is still shaking and his only choice is to move to the next area decreasing his oxygen value to 1 again. `[{1} .-...-..G_] =="W"==> [{1} .-...-...G]`: Finally to reach the top of the mountain he need to walk once again and completed his mission Don't worry about how Gunawan go home, because he is at the top of the tall mountain, to going home he simply jump of a cliff with his parachute :)

Input Format

N/A

Output Format

N/A