#!/usr/bin/perl
use Getopt::Long;

GetOptions ("group=s" => \$group,
	    "org=s" => \$org);

print "$org";
while (<>) {
    ($var1, $var2, $var3, $var4) = split();
    if ($var4 =~ /$org/) {
	if ($var3 =~ /$group/){
	    print "$var1\n";
	}
    }
}




