Chanek Jones is back, helping his long-lost relative Indiana Jones, to find a secret treasure in a maze buried below a desert full of illusions.

The map of the labyrinth forms a tree with n rooms numbered from 1 to n and n - 1 tunnels connecting them such that it is possible to travel between each pair of rooms through several tunnels.

The i-th room (1 ≤ i ≤ n) has a_i illusion rate. To go from the x-th room to the y-th room, there must exist a tunnel between x and y, and it takes max(|a_x + a_y|, |a_x - a_y|) energy. |z| denotes the absolute value of z.

To prevent grave robbers, the maze can change the illusion rate of any room in it. Chanek and Indiana would ask q queries.

There are two types of queries to be done:

  * 1\ u\ c — The illusion rate of the x-th room is changed to c (1 ≤ u ≤ n, 0 ≤ |c| ≤ 10^9). 
  * 2\ u\ v — Chanek and Indiana ask you the minimum sum of energy needed to take the secret treasure at room v if they are initially at room u (1 ≤ u, v ≤ n). 



Help them, so you can get a portion of the treasure!

Input

The first line contains two integers n and q (2 ≤ n ≤ 10^5, 1 ≤ q ≤ 10^5) — the number of rooms in the maze and the number of queries.

The second line contains n integers a_1, a_2, …, a_n (0 ≤ |a_i| ≤ 10^9) — inital illusion rate of each room.

The i-th of the next n-1 lines contains two integers s_i and t_i (1 ≤ s_i, t_i ≤ n), meaning there is a tunnel connecting s_i-th room and t_i-th room. The given edges form a tree.

The next q lines contain the query as described. The given queries are valid.

Output

For each type 2 query, output a line containing an integer — the minimum sum of energy needed for Chanek and Indiana to take the secret treasure.

Example

Input


6 4
10 -9 2 -1 4 -6
1 5
5 4
5 6
6 2
6 3
2 1 2
1 1 -3
2 1 2
2 3 3


Output


39
32
0

Note

<image>

In the first query, their movement from the 1-st to the 2-nd room is as follows.

  * 1 → 5 — takes max(|10 + 4|, |10 - 4|) = 14 energy. 
  * 5 → 6 — takes max(|4 + (-6)|, |4 - (-6)|) = 10 energy. 
  * 6 → 2 — takes max(|-6 + (-9)|, |-6 - (-9)|) = 15 energy. 

In total, it takes 39 energy.

In the second query, the illusion rate of the 1-st room changes from 10 to -3.

In the third query, their movement from the 1-st to the 2-nd room is as follows.

  * 1 → 5 — takes max(|-3 + 4|, |-3 - 4|) = 7 energy. 
  * 5 → 6 — takes max(|4 + (-6)|, |4 - (-6)|) = 10 energy. 
  * 6 → 2 — takes max(|-6 + (-9)|, |-6 - (-9)|) = 15 energy. 



Now, it takes 32 energy.
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,fma")
using namespace std;
using ull = unsigned long long;
const int N = 1e5 + 5, LG = 17, MOD = 1e9 + 7;
const long double PI = acos(-1);
int n, m;
int a[N];
vector<int> adj[N];
int pa[N][LG], lvl[N];
int in[N], out[N], timer;
long long t[N << 2], lz[N << 2];
void dfs(int u, int p) {
  in[u] = ++timer;
  for (int k = 1; k < LG; k++) pa[u][k] = pa[pa[u][k - 1]][k - 1];
  for (auto v : adj[u])
    if (v != p) {
      lvl[v] = lvl[u] + 1;
      pa[v][0] = u;
      dfs(v, u);
    }
  out[u] = timer;
}
int LCA(int u, int v) {
  if (lvl[u] > lvl[v]) swap(u, v);
  int d = lvl[v] - lvl[u];
  for (int k = 0; k < LG; k++)
    if (d >> k & 1) v = pa[v][k];
  if (u == v) return u;
  for (int i = LG - 1; i >= 0; --i)
    if (pa[u][i] != pa[v][i]) {
      u = pa[u][i];
      v = pa[v][i];
    }
  return pa[u][0];
}
void push(int node, int s, int e) {
  t[node] += lz[node];
  if (s != e) {
    lz[node << 1] += lz[node];
    lz[node << 1 | 1] += lz[node];
  }
  lz[node] = 0;
}
void update(int node, int s, int e, int l, int r, int val) {
  push(node, s, e);
  if (r < s || e < l) return;
  if (l <= s && e <= r) {
    lz[node] += val;
    push(node, s, e);
    return;
  }
  int md = (s + e) >> 1;
  update(node << 1, s, md, l, r, val);
  update(node << 1 | 1, md + 1, e, l, r, val);
  t[node] = t[node << 1] + t[node << 1 | 1];
}
int query(int node, int s, int e, int index) {
  push(node, s, e);
  if (s == e) return t[node];
  int md = (s + e) >> 1;
  if (index <= md) return query(node << 1, s, md, index);
  return query(node << 1 | 1, md + 1, e, index);
}
void doWork() {
  cin >> n >> m;
  for (int i = 1; i < n + 1; i++) {
    cin >> a[i];
    a[i] = abs(a[i]);
  }
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1, 1);
  for (int i = 1; i < n + 1; i++) update(1, 1, n, in[i], out[i], a[i]);
  while (m--) {
    int tp, x, y;
    cin >> tp >> x >> y;
    y = abs(y);
    if (tp == 1) {
      update(1, 1, n, in[x], out[x], y - a[x]);
      a[x] = y;
    } else {
      long long ans = query(1, 1, n, in[x]) * 2;
      ans += query(1, 1, n, in[y]) * 2;
      int L = LCA(x, y);
      ans -= query(1, 1, n, in[L]) * 2;
      if (L != 1) ans -= query(1, 1, n, in[pa[L][0]]) * 2;
      ans -= a[x];
      ans -= a[y];
      cout << ans << endl;
    }
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  while (t--) {
    doWork();
  }
  return 0;
}
