Byteasar is planning an excursion through Byteland. Some pairs of cities are joined by two-way bus connections. Byteasar wants a trip that starts and ends in the same city and never uses the same bus connection twice: once he has ridden the connection between two cities in either direction, he will not ride that connection again. The fare of such a closed route is the sum of the fares of the connections it uses.
Among all non-empty closed routes that use no bus connection more than once, find the smallest possible total fare, or report that no such route exists.
The first line contains two integers n and m separated by a single space (1≤n≤500, 0≤m≤50000): the number of cities and the number of two-way bus connections.
Each of the next m lines contains three integers xi, yi and ci (1≤xi,yi≤n, xi=yi, 1≤ci≤100000): a connection between cities xi and yi with fare ci. Each pair of cities is joined by at most one connection.
Print a single line with the minimum possible total fare of a non-empty closed route that uses no bus connection more than once. If no such route exists, print BRAK instead.