#!/usr/local/gnu/bin/perl

#
# Prints out the x,y coordinates of all reactions producing species $spec.
#

die "Usage: where N\n" unless $#ARGV >= 0;

$spec = $ARGV[0]; shift;

print STDERR "Searching for species $spec ...\n";

while (<>)
{
    #
    # Layout of events: N x y spec reac time
    #
    ($a,$b,$c,$d,$e,$f) = split(' ', $_);

    if ($d == $spec && $e != -1)
    {
        print $b, " ", $c, "\n";
    }
}
