Tree#6450

Tree

1 second
512 megabytes
Very easy

Little Annie loves drawing. Today at school she heard about graphs and trees. Upon arriving home, she decided to draw a tree. But it seemed to her that her tree is not beautiful. Then Annie took her paints, and colored all the nodes of a tree. But after some time, she got tired of this coloring, so she decided to repaint the nodes.

Annie says that a district of node with radius is a set of nodes which are accessible from the node by moving along at most edges. The tree is not directed, so each edge can be traversed in both directions. Sometimes when not busy repainting the nodes, she wonders how many different colors there are in some district. But it is very difficult for her to answer these questions, so Annie asks you to help her.

Input

The first line contains three integers , and ( ≤ ≤ , ≤ ≤ , ≤ ≤ ): the number of nodes in the tree, the maximum radius of the district, and the number of different colors in Annie's palette (the colors are numbered from to ). The second line contains integers c_i ( ≤ c_i ≤ ) describing the colors in which the nodes were originally painted. The following n - 1 lines contain the description of the tree: -th of them contains two integers a_i and b_i ( ≤ a_i, b_i ≤ ), indices of vertices joined by -th edge. It is guaranteed that the given graph is a tree.

The next line contains the number ( ≤ ≤ 10^5) of Annie's queries. The following lines contain the description of queries in the following format. The first integer d_i ( ≤ d_i ≤ ) is the type of query.

If d_i = , it is followed by two integers v_i and w_i ( ≤ v_i ≤ , ≤ w_i ≤ ): the number of a node being recolored and its new color.

If d_i = , it is followed by two integers v_i and k_i ( ≤ v_i ≤ , ≤ k_i ≤ ): the number of the center node of a district and its radius.

Output

For each query of the second type, print the number of different colors in the given district on a separate line.

Examples

Example 1

Loading
Loading