PROGRAMMING:Arrange papers
Given n papers with numbers from 1 to N and M citation relations in the form of D, u ($$1 / Le D, U / Le n, D / NEQ, u $), a noun defined in paper d is quoted in paper U. Now to rearrange these n papers, the arrangement scheme must meet the following requirements: the terms quoted by a paper must have been defined in the previous paper.
Please write a program to roughly calculate the number of schemes that meet the requirements. If there is no scheme that meets the requirements, output 0. If there is a unique scheme, output 1. If there are multiple schemes, output 2.
###Input format:
The input contains multiple groups of data, and the first line of each group of data is two positive integers n and m, which respectively represent the number of papers and the number of citation relations, both of which are not more than 100. Next, line M represents the citation relationship of the paper. Two positive integers D and u in the space interval of each line indicate that a noun defined in paper d is cited in paper U.
###Output format:
For each group of data, output an integer: if there is no permutation scheme meeting the requirements, output 0; if there is a unique scheme, output 1; if there are multiple schemes, output 2.
###Input example:
```in
5 4
1 5
5 2
3 2
4 3
5 4
3 1
4 2
1 5
5 4
```
###Output example:
```out
two
one
```
answer:If there is no answer, please comment
Please write a program to roughly calculate the number of schemes that meet the requirements. If there is no scheme that meets the requirements, output 0. If there is a unique scheme, output 1. If there are multiple schemes, output 2.
###Input format:
The input contains multiple groups of data, and the first line of each group of data is two positive integers n and m, which respectively represent the number of papers and the number of citation relations, both of which are not more than 100. Next, line M represents the citation relationship of the paper. Two positive integers D and u in the space interval of each line indicate that a noun defined in paper d is cited in paper U.
###Output format:
For each group of data, output an integer: if there is no permutation scheme meeting the requirements, output 0; if there is a unique scheme, output 1; if there are multiple schemes, output 2.
###Input example:
```in
5 4
1 5
5 2
3 2
4 3
5 4
3 1
4 2
1 5
5 4
```
###Output example:
```out
two
one
```
answer:If there is no answer, please comment