Peer Review

Time limit1sMemory limit128 MB

Problem

At scientific conferences, researchers submit papers describing their ideas and then review one another's papers, so that only strong work is presented. The organizers assign the reviews under three rules:

  • Every paper must be reviewed exactly $K$ times — never more, never fewer.
  • A researcher must not review a paper written by a collaborator. Researchers collaborate when they belong to the same institution, and every author collaborates with themselves, so no one may review their own paper.
  • A researcher must not review the same paper more than once.

Write a program that checks whether a conference followed all three rules, so the organizers learn about any violation before it is too late.

Input

The input contains several test cases. The first line of each test case has two integers $K$ ($1 \le K \le 5$) and $N$ ($1 \le N \le 1000$): $K$ is the number of reviews every paper is supposed to receive, and $N$ is the number of papers to review. Every paper has exactly one author and every author presents exactly one paper, so there are as many papers as authors.

Each of the next $N$ lines describes one author: the name of the institution the author belongs to, followed by the list of the $K$ papers that author was asked to review. Researchers from the same institution are assumed to collaborate; researchers from different institutions do not. Every institution name is shorter than 10 characters and consists only of upper- and lowercase letters with no whitespace. Papers are identified by the index of their author: paper $1$ was written by the first author listed, and paper $N$ by the last.

A line containing $K = 0$ and $N = 0$ marks the end of the input and must not be processed.

Output

For each test case, print one line:

  • NO PROBLEMS FOUND if every paper obeyed all three rules.
  • 1 PROBLEM FOUND if exactly one paper broke a rule.
  • P PROBLEMS FOUND if $P$ papers broke a rule, where $P \ge 2$.

A paper that breaks several rules still counts as a single problem. Produce no output for the terminating 0 0 line.