CF980F Cactus to Tree

Description

You are given a special connected undirected graph where each vertex belongs to at most one simple cycle. Your task is to remove as many edges as needed to convert this graph into a tree (connected graph with no cycles). For each node, independently, output the maximum distance between it and a leaf in the resulting tree, assuming you were to remove the edges in a way that minimizes this distance.

Input Format

N/A

Output Format

N/A

Explanation/Hint

In the first sample, a possible way to minimize the maximum distance from vertex $ 1 $ is by removing the marked edges in the following image: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF980F/d13d25f60c285f8d538580e264fb1f41c3027f5d.png)Note that to minimize the answer for different nodes, you can remove different edges.