SP30922 ADAVISIT - Ada and Plum

Description

Ada the Ladybug is visiting her friends who live on a plum [tree](https://en.wikipedia.org/wiki/Tree_(data_structure)). As many bugs like her, she has a friend in each node. She has already planed in which order she will visit them. She does that in following manner. If she is standing at a node **i** in the morning, she will choose shortest path to friend with number **i+1**. Afterward, she stays there until next morning. First day she "magically" apears on node number **1** and as she arrives at node **N**, she ends her journey. Your task is to find (for each node), the number of days she visited it (this means she either begins in it, ends in it or passes through it).

Input Format

The first line contains **1 , number of nodes on tree.** Each of next **N-1** lines contains two integers **1 , **I ≠ J**, the nodes which are connected by an edge.**

Output Format

Print **N** lines with and integer indicating number of times **i $ ^{th} $** node was visited.