@P=split//,".URRUUxR";@d=split//,"\nlanruoJ lreP ehT";sub p{@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";$p++;($q*=2)+=$f=!fork;map{$P=$P[$f|6&ord$p{$_}];$p{$_}=/$P/i?$P:close$_}%p}p;p;p;p;p;map$p{$_}=~/[P.]/&&close$_,%p;wait until$?;map/r/&&<$_>,%p;print$d[$q]
