#!/bin/perl5 -w

$\ = "\n";

$name = shift;

LINE:
    while (<>) {
	chomp;

	if (/ SG.*$name/i)
	{
	    $title = substr($_,19,38);
	    $title =~ s,[ \t]*\#\d*(/\d+)?[a-z]?,,g;
	    $title =~ s,\(\d/\d\),,;
	    $title =~ s/[ \t]*$//;
	    push @titles, ($title);
	}
    }

$oldtitle = "";

for $title (sort @titles)
{
    if (lc($title) ne lc($oldtitle)) {print $title}
    $oldtitle = $title;
}
