#!/usr/bin/perl -w

my %rules;
my $last = '';
while (<>) {
    my $line = $_;
    if ($line eq "\n") {
	if ($last =~ /^(.*):\s*$/) {
	    if (defined $rules{$1}) {
		$last = '';
		next;
	    }
	    $rules{$1} = 1;
	}
    }
    print $last;
    $last = $line;
}
print $last;
