#!/usr/bin/perl -p

BEGIN { @fields = map {$_>0 ? $_-1 : $_} @ARGV; @ARGV = (); $last = '' }

chomp;
@F=split/\t/,$_,-1;
$this = join"\t",@F[@fields];
if ($this ne $last && $last ne '') { print "\n"; }
$last = $this;
$_ = "$_\n";
