PROGRAMMING:Minimum working period
A project consists of several tasks, and there is a sequence of tasks. The project manager needs to set a series of milestones, check the completion of tasks at each milestone node, and start subsequent tasks. Now, given the relationship between tasks in a project, please calculate the earliest completion time of the project.
###Input format:
First, the first line gives two positive integers: the number of project milestones $$n $$($$Le 100 $$) and the total number of tasks $$M $$. The milestones here are numbered from 0 to $$n-1 $. In the following $$M $$lines, each line gives a description of a task in the format of "task start milestone task end milestone working time". The three numbers are non negative integers separated by spaces.
###Output format:
If the arrangement of the whole project is reasonable and feasible, output the earliest completion time in one line; Otherwise, output "impossible".
###Input sample 1:
```in
9 12
0 1 6
0 2 4
0 3 5
1 4 1
2 4 1
3 5 2
5 4 0
4 6 9
4 7 7
5 7 4
6 8 2
7 8 4
```
###Output sample 1:
```out
eighteen
```
###Input example 2:
```in
4 5
0 1 1
0 2 2
2 1 3
1 3 4
3 2 5
```
###Output example 2:
```out
Impossible
```
answer:If there is no answer, please comment
###Input format:
First, the first line gives two positive integers: the number of project milestones $$n $$($$Le 100 $$) and the total number of tasks $$M $$. The milestones here are numbered from 0 to $$n-1 $. In the following $$M $$lines, each line gives a description of a task in the format of "task start milestone task end milestone working time". The three numbers are non negative integers separated by spaces.
###Output format:
If the arrangement of the whole project is reasonable and feasible, output the earliest completion time in one line; Otherwise, output "impossible".
###Input sample 1:
```in
9 12
0 1 6
0 2 4
0 3 5
1 4 1
2 4 1
3 5 2
5 4 0
4 6 9
4 7 7
5 7 4
6 8 2
7 8 4
```
###Output sample 1:
```out
eighteen
```
###Input example 2:
```in
4 5
0 1 1
0 2 2
2 1 3
1 3 4
3 2 5
```
###Output example 2:
```out
Impossible
```
answer:If there is no answer, please comment