- Time limit: 1.00 s
- Memory limit: 512 MB
You are given a tree consisting of nodes, and paths in the tree.
Your task is to calculate for each node the number of paths containing that node.
Input
The first input line contains integers and : the number of nodes and paths. The nodes are numbered .
Then there are lines describing the edges. Each line contains two integers and : there is an edge between nodes and .
Finally, there are lines describing the paths. Each line contains two integers and : there is a path between nodes and .
Output
Print integers: for each node , the number of paths containing that node.
Constraints
Example
Input:
5 3 1 2 1 3 3 4 3 5 1 3 2 5 1 4
Output:
3 1 3 1 1