sub record { ($g,$p)=@_; $w=3;$t=1; $wT=int($p/$w); $tT=$p-($wT*$w); $lT=$g-($wT+$tT); ($wT,$lT,$tT); }