#!/usr/local/bin/perl5

while ($line = <STDIN>) {
    chop($line);
    $_ = $line;
    if (/^(roll\d+)(.+)$/) {
	if ($1 eq "roll01") {
	    $num = "02";
	} elsif ($1 eq "roll02") {
	    $num = "04";
	} elsif ($1 eq "roll03") {
	    $num = "08";
	} elsif ($1 eq "roll04") {
	    $num = "06";
	} elsif ($1 eq "roll05") {
	    $num = "09";
	} elsif ($1 eq "roll06") {
	    $num = "05";
	} elsif ($1 eq "roll07") {
	    $num = "01";
	} elsif ($1 eq "roll08") {
	    $num = "07";
	} elsif ($1 eq "roll09") {
	    $num = "03";
	} elsif ($1 eq "roll10") {
	    $num = "10";
	} else {
	    print STDERR "Error in filename!\n";
	}
	system("cp $line $num$2");
    } else {
	print STDERR "Error!  Filename $line doesn't contain 'roll'.\n";
    }
}
