/(H\(\d+\))/,push@{$count{$1}},"$_\n"for@rec; print map{$#{$count{$_}}?@{$count{$_}}:''}keys%count;