#!perl -pl substr$x,$_,0,for$a=$_/96,~~grep($a>4?$a+=$_:0,-3..0),$_/16%6,sort$_*2&6|1,$_/2&6,$x=RKR;$_=$x