B. Honkai in TAIKULA
time limit per test
4 с
memory limit per test
256 megabytes
input
standard input
output
standard output

TAIKULA is a complex galaxy made up of $$$n$$$ distinct stars, indexed from $$$0$$$ to $$$n-1$$$ and interconnected through $$$m$$$ directed star rails. Our tale unfolds with the daring crew of the Astral Express, specifically two members, March 7th and Dan Heng, assigned the critical task of delivering rare relics within TAIKULA. Their mission is disrupted by an unexpected onslaught from the Honkai at the Space Station. Fortunately, March and Dan, along with chief researcher Asta and security head Arlan, manage to repel the attackers.

However, these Honkai encounters have now become an unfortunate yet regular nuisance along the star rails, causing various losses. In response, Asta takes upon the task of estimating the potential losses associated with each star rail, assigning them integer values on his map. It is noteworthy that these integers can be negative since some of the weaker yet affluent Honkai might be defeated, leading to the Astral Express acquiring valuable equipment or materials.

The standard protocol for any business transportation within TAIKULA involves starting from a star $$$x$$$, traversing across other (at least one) stars, and eventually returning to the original star $$$x$$$ for necessary maintenance. During this transportation, stars and star rails might be visited multiple times, including the starting star. Asta is keen on minimizing the incurred loss from each starting star as much as possible.

Interestingly, the Honkai exhibit a peculiar habit in TAIKULA. They only plunder odd-numbered goods during a transportation, and their aggression levels rise exponentially in the face of an even loss. This leads Asta to seek your expertise as a Trailblazer with the power of Stellaron. Your mission is to plan a transportation route from each starting star that results in the least possible odd loss. To expedite the process, you only need to calculate the minimum odd loss from each starting star.

Input

The first line contains two integers $$$n,m$$$ ($$$1\le n\le 1000$$$, $$$1\le m\le 10^4$$$), indicating the number of stars and star rails.

Each of the following $$$m$$$ lines contains $$$3$$$ integers $$$x_i,y_i,w_i$$$ ($$$0\le x_i,y_i \lt n$$$, $$$|w_i|\le 10^7$$$), identifying a directed star rail from star $$$x_i$$$ to star $$$y_i$$$ with $$$w_i$$$ loss.

Output

The output should consist of $$$n$$$ lines. The $$$i$$$-th line should identify the minimum odd loss for the $$$(i-1)$$$-th starting star. If a transportation with an odd loss does not exist, output $$$\texttt{Battle with the crazy Honkai}$$$. Otherwise, if the minimum odd loss is finite, output the loss. If it is infinite, output $$$\texttt{Haha, stupid Honkai}$$$.

Examples
Input
2 2
0 1 1
1 0 1
Output
Battle with the crazy Honkai
Battle with the crazy Honkai
Input
2 2
0 1 0
1 0 1
Output
1
1
Input
2 2
0 1 -1
1 0 0
Output
Haha, stupid Honkai
Haha, stupid Honkai
Input
2 2
0 1 2
1 0 -1
Output
1
1