- Time limit: 1.00 s
- Memory limit: 512 MB
The internet connection between Teemu and Taina has had problems lately. Before more investigation on the subject, Teemu decided to find out the theoretical maximum rate at which he can send data to Taina.
Can you help Teemu to calculate the maximum rate?
Input
The first line of the input has two integers and : the number of computers and number of connections in the network. Computers are numbered . Computer is owned by Teemu and computer by Taina.
After the first line lines follow, each of which describe one connection between computers. Each line has three integers , and . This means that computer can send data to computer at a rate of bytes/s. There is at most one connection from computer to and no connection connects a computer to itself.
Output
Your program should print one integer: the maximum rate (bytes/s) at which Teemu can send data to Taina.
Limits
Examples
Input:
4 5 1 2 2 1 3 5 2 4 3 3 2 2 3 4 1
Output:
4