def initialize ( stdin, stdout, stderr, argv )
gre, neg, exc = [], [], []
argv.each do |arg|
case arg
when /^(.*)!$/ then exc << $1
when /^(.*)-$/ then neg << $1
else gre << arg
end
end
stdout.puts Diff.new(stdin.read).exclude(exc).negative(neg).grep(gre)
end