#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

struct Graph {
	vector<vector<ll>> adj;
	vector<bool> visited;
	int n;
};

Graph g;

void init(int n)
{
	g.adj.resize(n);
	g.visited.resize(n, false);
	g.n = n;
}

void addEdge(int u, int v)
{
	g.adj[u].push_back(v);
	g.adj[v].push_back(u);
}

void solve()
{
	ll n;
	cin >> n;
	init(n);
	vector<ll> arr(n);
	for (int i = 0; i < n; i++)
	{
		cin >> arr[i];	
	}
	for (int i = 0; i < n-1; i++)
	{
		int u, v;
		cin >> u >> v;
		addEdge(u, v);
	}
	int q;
	cin >> q;
	for (int i = 0; i < q; i++)
	{
		int x;
		cin >> x;
		if (x == 1)
		{
			int a, b;
			cin >> a >> b;
			
		}
		else if (x == 2)
		{
			int l, r, x;
			cin >> l >> r >> x;
			cout << 1 << "\n";
		}
	}
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	solve();
	return 0;
}