// Born_To_Laugh - Hughie Do
#include <bits/stdc++.h>
#define alle(AC) AC.begin(), AC.end()
#define fi first
#define se second
using namespace std;
typedef long long ll;
[[maybe_unused]] const int MOD = 998244353, INF = 1e9 + 7;
const int maxn = 2e5 + 10;
int n, m, q;
vector<int> adj[maxn];
multiset<int> pos1[maxn], pos2[maxn];
int binlift[maxn][20], dep[maxn];
int inp[maxn], inp1[maxn];
void dfs(int a, int par){
for(auto &elm: adj[a]){
if(elm == par)continue;
binlift[elm][0] = a;
for(int i=1; i<20; ++i)
binlift[elm][i] = binlift[binlift[elm][i - 1]][i - 1];
dep[elm] = dep[a] + 1;
dfs(elm, a);
}
}
int lca(int a, int b){
if(dep[a] < dep[b]) swap(a, b);
int k = dep[a] - dep[b];
for(int i=19; i>=0; --i){
if(k & (1 << i)) a = binlift[a][i];
}
if(a == b) return a;
for(int i=19; i>=0; --i){
if(binlift[a][i] != binlift[b][i]){
a = binlift[a][i];
b = binlift[b][i];
}
}
return binlift[a][0];
}
void solve(){
cin >> n >> m >> q;
for(int i=1; i<n; ++i){
int a, b;cin >> a >> b;
adj[a].push_back(b);
adj[b].push_back(a);
}
for(int i=1; i<=m; ++i){
cin >> inp[i];
pos1[inp[i]].insert(i);
}
dfs(1, -1);
for(int i=1; i<m; ++i){
inp1[i] = lca(inp[i], inp[i + 1]);
pos2[inp1[i]].insert(i);
}
while(q--){
int type;cin >> type;
if(type == 1){
int x, y;cin >> x >> y;
pos1[inp[x]].erase(x);
pos2[inp1[x]].erase(x);
if(x > 1) pos2[inp1[x - 1]].erase(x - 1);
inp[x] = y;
inp1[x] = lca(inp[x], inp[x + 1]);
if(x > 1) inp1[x - 1] = lca(inp[x - 1], inp[x]);
pos1[inp[x]].insert(x);
pos2[inp1[x]].insert(x);
if(x > 1) pos2[inp1[x - 1]].insert(x - 1);
}
else{
int l, r, x;cin >> l >> r >> x;
auto id = pos1[x].lower_bound(l);
if(id != pos1[x].end() && (*id) <= r){
cout << (*id) << ' ' << (*id) << '\n';
continue;
}
auto id1 = pos2[x].lower_bound(l);
if(id1 != pos2[x].end() && (*id1) < r){
cout << (*id1) << ' ' << (*id1) + 1 << '\n';
continue;
}
cout << -1 << ' ' << -1 << '\n';
}
}
}
signed main(){
// freopen("inp.txt", "r", stdin);
// freopen("out.txt", "w", stdout);
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
solve();
}