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"
using namespace std;
struct edge {
  int32_t v;
};
template<typename edge>
struct HLD {
  int *p, *h, *heavy, *head, *pos, posmk = 0;
  int dfs(int u, vector<vector<edge>> const& g) {
    int sz = 1, msz = 0, csz;
    for (auto &e : g[u]) if (e.v != p[u]) {
      p[e.v] = u;
      h[e.v] = h[u] + 1;
      csz = dfs(e.v, g);
      sz += csz;
      if (csz > msz) msz = csz, heavy[u] = e.v;
    }
    return sz;
  }
  void hld(int u, int hd, vector<vector<edge>> const& g) {
    head[u] = hd;
    pos[u] = posmk ++;
    if (heavy[u] != -1) hld(heavy[u], hd, g);
    for (auto &e : g[u]) if (e.v != p[u] && e.v != heavy[u])
      hld(e.v, e.v, g);
  }
  void build(int n, vector<vector<edge>> const& g, int root = 0) {
    p = new int[n];
    heavy = new int[n];
    h = new int[n];
    head = new int[n];
    pos = new int[n];
    fill(heavy, heavy + n, -1);
    fill(head, head + n, -1);
    h[root] = 0, posmk = 0, p[root] = -1;
    dfs(root, g);
    hld(0, 0, g);
  }
  HLD(int n, vector<vector<edge>> const& g, int root = 0) {
    build(n, g, root);
  }
};
template<class node> 
struct segment_tree : node {
  using node_t = typename node::node_t;
  const node_t identity = node::identity;
  using node::merge;
  using i32 = int32_t;
  node_t *t;
  i32 n, mleft, mright;
  #define md ((l + r) >> 1)
  void build(i32 i, i32 l, i32 r, vector<node_t> &z) {
    if (l == r) {
      t[i] = z[l];
      return;
    } else {
      build(i << 1, l, md, z);
      build(i << 1 | 1, md + 1, r, z);
      t[i] = merge(t[i << 1], t[i << 1 | 1]);
    }
  }
  void __update(i32 i, i32 l, i32 r, i32 p, node_t x) {
    if (l == r) {
      t[i] = x;
    } else {
      if (p <= md) __update(i << 1, l, md, p, x);
      else __update(i << 1 | 1, md + 1, r, p, x);
      t[i] = merge(t[i << 1], t[i << 1 | 1]);
    }
  }
  i32 _L, _R;
  node_t collector;
  void __query(i32 i, i32 l, i32 r) {
    if (l > _R || _L > r) return;
    if (_L <= l && r <= _R) collector = merge(collector, t[i]);
    else {
      __query(i << 1, l, md);
      __query(i << 1 | 1, md + 1, r);
    }
  } 
  void init(i32 _n, vector<node_t> z = vector<node_t>(), bool zero_indexed = false) {
    n = _n;
    t = new node_t[n << 2 | 1];
    fill(t, t + (n << 2 | 1), identity);
    mleft = (zero_indexed ? 0 : 1);
    mright = (zero_indexed ? n - 1 : n);
    if (z.size()) build(1, mleft, mright, z);
  }
  segment_tree() {}
  segment_tree(i32 _n, vector<node_t> z = vector<node_t>(), bool zero_indexed = false) {
    init(_n, z, zero_indexed);
  }
  void update(i32 p, node_t x) {
    __update(1, mleft, mright, p, x);
  }
  node_t query(i32 L, i32 R) {
    if (L > R) return identity;
    _L = L; _R = R;
    collector = identity;
    __query(1, mleft, mright);
    return collector;
  }
};
class node {
public:
  using node_t = long long;
  constexpr static node_t identity = 0;
  constexpr static node_t merge(const node_t lhs, const node_t rhs) {
    return lhs + rhs;
  }
};
void solution() {
  using i64 = long long;
  int n, q;
  cin >> n >> q;
  vector<vector<edge>> g(n);
  vector<i64> a(n);
  for (i64 &u : a) {
    cin >> u;
    u = abs(u);
  }
  for (int i = 0; i < n - 1; i ++) {
    int u, v;
    cin >> u >> v;
    u --;
    v --;
    g[u].push_back({v});
    g[v].push_back({u});
  }
  HLD hld(n, g);
  vector<i64> temp(n);
  for (int i = 0; i < n; i ++) temp[hld.pos[i]] = abs(a[i]);
  segment_tree<node> t(n, temp, true);
  while (q --) {
    int type;
    cin >> type;
    if (type == 1) {
      int u, v;
      cin >> u >> v;
      u --;
      v = abs(v);
      t.update(u, v);
      a[u] = v;
    } else {
      int x, y;
      cin >> x >> y;
      x --, y --;
      long long ans = -a[x] - a[y];
      for (; hld.head[x] != hld.head[y]; y = hld.p[hld.head[y]]) {
        if (hld.h[hld.head[x]] > hld.h[hld.head[y]]) swap(x, y);
        ans += t.query(hld.pos[hld.head[y]], hld.pos[y]) * 2;
      }
      if (hld.h[x] > hld.h[y]) swap(x, y);
      ans += t.query(hld.pos[x], hld.pos[y]) * 2;
      cout << ans << "\n";
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(0); cin.tie(0); 
  int tc = 1;
#ifdef DEBUG
  freopen("input.txt", "r", stdin);
#endif
  // cin >> tc;
  for (int test = 1; test <= tc; test ++) {
    solution();
    cout << "\n";
  }
}