Given an undirected graph G=(V,E). All vertices are numbered from 1 to N. And every vertex u has a value of $A_u$. Let $S_u$={$A_v$│(u,v)∈E}. Also, F(u) equals MEX(minimum excludant) value of $S_u$. A MEX value of a set is the smallest non-negative integer which doesn’t exist in the set.
There are two types of queries.
Type 1: 1 u x – Change $A_u$ to x (0≤x≤$10^9$).
Type 2: 2 u – Calculate the value of F(u).
For each query of type 2, you should answer the query.