#!/usr/local/bin/perl

open(gradPauto, ">GPauto");
open(gradMauto, ">GMauto");
open(gradMman, ">GMman");
open(gradPman, ">GPman");

while ($line = <>) {
    if ($line =~ /^([\S]+) ([+\-]) ([+\-])/) {
	$word = $1;
        $man = $2;
	$auto = $3;
        if ($man eq "+") {
	    print gradPman "$word\n";
	}
	else  {
	    print gradMman "$word\n";
	}
        if ($auto eq "+") {
	    print gradPauto "$word\n";
	}
	else  {
	    print gradMauto "$word\n";
	}

    }
}
close(gradPauto);
close(gradMauto);
close(gradMman);
close(gradPman);









