#K85197. Taco Sentiment Classification

    ID: 36588 Type: Default 1000ms 256MiB

Taco Sentiment Classification

Taco Sentiment Classification

You are given three lists of words representing positive, negative, and neutral sentiments, and a series of comments. For each comment, count the number of words that appear in the positive list and in the negative list. If the number of positive words is greater than the number of negative words, the comment is classified as positive. If the number of negative words exceeds the number of positive words, the comment is classified as negative. Otherwise, the comment is classified as neutral.

Formally, let \(P\) be the count of words in the comment that are in the positive list and \(N\) be the count of words in the comment that are in the negative list. Then the classification is defined as follows:

\[ \text{classification} = \begin{cases} \text{positive} & \text{if } P > N, \\ \text{negative} & \text{if } N > P, \\ \text{neutral} & \text{if } P = N. \end{cases} \]

Note: The neutral word list is provided as part of the input for uniformity but does not affect the classification.

inputFormat

The input is read from stdin and has the following format:

  1. An integer n denoting the number of positive words.
  2. A single line with n space-separated positive words.
  3. An integer m denoting the number of negative words.
  4. A single line with m space-separated negative words.
  5. An integer p denoting the number of neutral words.
  6. A single line with p space-separated neutral words.
  7. An integer k representing the number of comments.
  8. k lines, each line is a comment.

outputFormat

For each comment, output its classification (positive, negative, or neutral) on a separate line to stdout.

## sample
3
good great happy
3
bad terrible sad
3
okay fine average
5
i am feeling great today
this is a terrible day
i think it is okay
i am so happy
this is just bad
positive

negative neutral positive negative

</p>