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.
/*
 * File created on 10/09/2021 at 19:25:04.
 * Link to problem: 
 * Description: 
 * Time complexity: O()
 * Space complexity: O()
 * Status: ---
 * Copyright: Ⓒ 2021 Francois Vogel
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>

using namespace std;
using namespace __gnu_pbds;

#define pii pair<int, int>
#define f first
#define s second

#define vi vector<int>
#define all(x) x.begin(), x.end()
#define size(x) (int)(x.size())
#define pb push_back
#define ins insert
#define cls clear

#define int ll
#define ll long long
#define ld long double

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

const int siz = 1e5+40;
const int p2 = 1<<20;
const int inf = 1e18;

vi graph [siz];
int b [siz];
int st [siz];
int en [siz];
int rf [siz];

struct LCA {
    LCA() {
        t = new pii [p2*2];
        for (int i = 0; i < p2*2; i++) t[i] = pii(inf, inf);
    }
    void upd(int x, pii v) {
        x += p2;
        t[x] = v;
        for (x /= 2; x; x /= 2) t[x] = min(t[x*2], t[x*2+1]);
    }
    int get(int b, int e) {
        b += p2;
        e += p2;
        pii v = pii(inf, inf);
        while (b <= e) {
            if (b%2 == 1) {
                v = min(v, t[b]);
                b++;
            }
            if (e%2 == 0) {
                v = min(v, t[e]);
                e--;
            }
            b /= 2;
            e /= 2;
        }
        return v.s;
    }
    pii* t;
};

struct Segtree {
    Segtree() {
        t = new int [p2*2];
        for (int i = 0; i < p2*2; i++) t[i] = 0;
    }
    void upd(int b, int e, int v) {
        b += p2;
        e += p2;
        while (b <= e) {
            if (b%2 == 1) {
                t[b] += v;
                b++;
            }
            if (e%2 == 0) {
                t[e] += v;
                e--;
            }
            b /= 2;
            e /= 2;
        }
    }
    int get(int x) {
        int sum = 0;
        for (x += p2; x; x/= 2) sum += t[x];
        return sum;
    }
    int* t;
};

int tim = 0;
void dfs(int x, int p, vi& path) {
    st[x] = en[x] = tim++;
    path.pb(x);
    for (int y : graph[x]) if (y != p) {
        dfs(y, x, path);
        path.pb(x);
        en[x] = en[y];
    }
}

signed main() {
    cin.tie(0);
    ios_base::sync_with_stdio(0);

    int n, nbQ;
    cin >> n >> nbQ;
    for (int i = 0; i < n; i++) {
        cin >> b[i];
        b[i] = max(b[i], -b[i]);
    }
    for (int i = 0; i < n-1; i++) {
        int na, nb;
        cin >> na >> nb;
        na--;
        nb--;
        graph[na].pb(nb);
        graph[nb].pb(na);
    }
    vi path;
    dfs(0, -1, path);
    LCA lca = LCA();
    for (int i = 0; i < size(path); i++) {
        lca.upd(i, pii(path[i], i));
        rf[i] = i;
    }
    Segtree q = Segtree();
    for (int i = 0; i < n; i++) q.upd(st[i], en[i], b[i]);
    for (int i = 0; i < nbQ; i++) {
        int typ;
        cin >> typ;
        if (typ == 1) {
            int x, v;
            cin >> x >> v;
            v = max(v, -v);
            x--;
            q.upd(st[x], en[x], v-b[x]);
            b[x] = v;
        }
        else {
            int x, y;
            cin >> x >> y;
            x--;
            y--;
            int z = lca.get(min(rf[x], rf[y]), max(rf[x], rf[y]));
            int loc = q.get(st[x])+q.get(st[y])-2LL*q.get(st[z]);
            loc += b[z];
            loc *= 2LL;
            loc -= b[x];
            loc -= b[y];
            cout << loc;
            cout << '\n';
        }
    }

    cout.flush();
    int d = 0;
    d++;
}