Yash loves playing with trees and gets especially excited when they have something to do with prime numbers. On his 20th birthday he was granted with a rooted tree of *n* nodes to answer queries on. Hearing of prime numbers on trees, Yash gets too intoxicated with excitement and asks you to help out and answer queries on trees for him. Tree is rooted at node 1. Each node *i* has some value *a*<sub class="lower-index">*i*</sub> associated with it. Also, integer *m* is given.

There are queries of two types:
 1.  for given node *v* and integer value *x*, increase all *a*<sub class="lower-index">*i*</sub> in the subtree of node *v* by value *x* 1.  for given node *v*, find the number of prime numbers *p* less than *m*, for which there exists a node *u* in the subtree of *v* and a non-negative integer value *k*, such that *a*<sub class="lower-index">*u*</sub> = *p* + *m*·*k*.
The first of the input contains two integers *n* and *m* (1 ≤ *n* ≤ 100 000, 1 ≤ *m* ≤ 1000) — the number of nodes in the tree and value *m* from the problem statement, respectively.

The second line consists of *n* integers *a*<sub class="lower-index">*i*</sub> (0 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>) — initial values of the nodes.

Then follow *n* - 1 lines that describe the tree. Each of them contains two integers *u*<sub class="lower-index">*i*</sub> and *v*<sub class="lower-index">*i*</sub> (1 ≤ *u*<sub class="lower-index">*i*</sub>, *v*<sub class="lower-index">*i*</sub> ≤ *n*) — indices of nodes connected by the *i*-th edge.

Next line contains a single integer *q* (1 ≤ *q* ≤ 100 000) — the number of queries to proceed.

Each of the last *q* lines is either 1 v x or 2 v (1 ≤ *v* ≤ *n*, 0 ≤ *x* ≤ 10<sup class="upper-index">9</sup>), giving the query of the first or the second type, respectively. It's guaranteed that there will be at least one query of the second type.
none
print("_RANDOM_GUESS_1689445029.1878014")# 1689445029.187821