while ( $line = <> ){
    if ( $line =~ /\d+(ax|by)/ ){
	print $line;
    }
}
