Pink Floyd
The band Pink Floyd is going to go on a new concert tour around the world. From previous experience, the group knows that lead singer Roger Waters is constantly nervous when flying. On some routes he loses weight from excitement, while on others he eats a lot and gains weight.
It is known that the more Roger weighs, the better the band performs, so it is necessary to plan flights so that Roger’s weight at each concert is as high as possible.
The group must visit cities in the same order in which it gives concerts, and the group may visit intermediate cities between concerts.
Input
The first line of the input file contains three natural numbers , and - the number of cities in the world, the number of flights and the number of concerts that the group should give, respectively . Cities are numbered from to .
The next lines contain descriptions of flights, one per line. Flight number is described by three numbers , and - the number of the initial and final city of the flight and the expected change in Roger's weight in milligrams .
The last line contains the numbers - the numbers of the cities in which the concerts are held. At the beginning of the concert tour, the group is in the city of .
It is guaranteed that the group can perform all concerts.
Output
The first line of the output file should contain the number - the number of trips that the group should make. The second line should contain numbers - the numbers of the flights used.
If there is a sequence of routes between gigs such that Roger will gain weight indefinitely, then the first line of the output file should contain the message 'infinitely kind'.