You are given a tree consisting of $n$ nodes.
Your task is to determine for each node the maximum distance to another node.
### Input
- The first line contains an integer $n$.
- The next $n - 1$ lines, each line contains 2 integers $u$ and $v$, there is an edge between $u$ and $v$.
### Output
- Print $n$ integers: for each node from $1$ to $n$, the maximum distance to another node.
### Constraints
- $1 \le n \le 10^5$.
- $1 \le u, v \le n$.
### Example
Input:
```
5
1 2
1 3
3 4
3 5
```
Output:
```
2 3 2 3 3
```