$o={0,[R0,{0,[RRRL1R3LRLRLRRLRLLRLRRRLRLR1L1RLRL],1,[FR2RLR12R4RLRLRL2LRLRRLR1L2LLRLRLRRRLRL],2,[F1L0,{2,[FLRRLLRLR6RRLRLLRLRLRRLRRL2LRR6LRLLRLLRLRLRRR6L],4,[F2R7L12R7LRL]}],5,[F1LL1R]}],1,[FLLRRRRLR1LRL3LRLLRR2LLR],2,[R0,{0,[LLLLLLL],1,[LL],2,[LRRLLLRRLR],3,[B8R],4,[FLRRLR],8,[FLRR]}],3,[L1L7RL3R],4,[FRL7LLR2R3L2RLLRRLL2RRL],14,[FRRRRRRRRLLLLLLLLR],16,[FL8L]}; sub dist{<>+0} sub move {$|=print"@_\n";dist} $t=dist; while($o){ while($t>99){ $t=move F; } exit if $t=~M; $o=$o->{$t}; $_=$o->[0]; $o=$o->[1]; while(s/(.)(\d*)//){ my$_=$1; my$s=$2; $t=move$_ if/R/||/L/; $_=/B/?B:F; while($s eq ''?$t>0:$s--){ $t=move$_; } } } { print"R\n"; do{ $d+=print"L\n"while<><++$|||$m[$y=($x+30**($d&=3))%901]^($m[$x]=$d^4)^2&&$m[$y]; $x=$y; $d-=print"F\nR\n"; }until<>=~M; }