#!/usr/bin/perl do shift;{($t[$h],$*,$m)=@{$b{$m}{$t[$h]||0}};$h+=$*;$m?redo:die@t,$/}