#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = 10 * x + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int Size = 200001;
struct Edge {
  long long from, pos, v;
} w[Size << 1];
vector<Edge> to[Size];
long long n, q, cnt, anc[Size][21];
long long l[Size], r[Size], order[Size];
long long toroot[Size], dist[Size], deep[Size];
bool vis[Size];
struct Segment_Tree {
  struct node {
    int l, r;
    long long v, lazy;
  } tree[Size << 2];
  inline void Pushup(int rt) {
    tree[rt].v = min(tree[rt << 1].v, tree[rt << 1 | 1].v);
  }
  void Pushdown(int rt) {
    if (tree[rt].lazy) {
      tree[rt << 1].v += tree[rt].lazy;
      tree[rt << 1 | 1].v += tree[rt].lazy;
      tree[rt << 1].lazy += tree[rt].lazy;
      tree[rt << 1 | 1].lazy += tree[rt].lazy;
      tree[rt].lazy = 0;
    }
  }
  void Build1(int l = 1, int r = n, int rt = 1) {
    tree[rt].l = l;
    tree[rt].r = r;
    if (l == r) {
      tree[rt].v = toroot[order[l]] + dist[order[l]];
      return;
    }
    int mid = (tree[rt].l + tree[rt].r) >> 1;
    Build1(l, mid, rt << 1);
    Build1(mid + 1, r, rt << 1 | 1);
    Pushup(rt);
  }
  void Build2(int l = 1, int r = n, int rt = 1) {
    tree[rt].l = l;
    tree[rt].r = r;
    if (l == r) {
      tree[rt].v = dist[order[l]];
      return;
    }
    int mid = (tree[rt].l + tree[rt].r) >> 1;
    Build2(l, mid, rt << 1);
    Build2(mid + 1, r, rt << 1 | 1);
    Pushup(rt);
  }
  void Update(int l, int r, int v, int rt) {
    if (l <= tree[rt].l && tree[rt].r <= r) {
      tree[rt].v += v;
      tree[rt].lazy += v;
      return;
    }
    Pushdown(rt);
    int mid = (tree[rt].l + tree[rt].r) >> 1;
    if (l <= mid) Update(l, r, v, rt << 1);
    if (r > mid) Update(l, r, v, rt << 1 | 1);
    Pushup(rt);
  }
  long long Query(int l, int r, int rt) {
    if (l <= tree[rt].l && tree[rt].r <= r) {
      return tree[rt].v;
    }
    Pushdown(rt);
    long long mid = (tree[rt].l + tree[rt].r) >> 1, ans = 1000000000000;
    if (l <= mid) ans = min(ans, Query(l, r, rt << 1));
    if (r > mid) ans = min(ans, Query(l, r, rt << 1 | 1));
    return ans;
  }
} tree1, tree2;
void dfs(int x, long long p, long long dp) {
  deep[x] = dp;
  order[l[x] = ++cnt] = x;
  vis[x] = true;
  dist[x] = p;
  int len = to[x].size();
  for (int i = 0; i < len; i++) {
    int nxt = to[x][i].pos;
    if (!vis[nxt]) {
      anc[nxt][0] = x;
      dfs(nxt, p + to[x][i].v, dp + 1);
    }
  }
  r[x] = cnt;
}
void init() {
  n = read();
  q = read();
  for (int i = 1; i < n; i++) {
    w[i].from = read();
    w[i].pos = read();
    w[i].v = read();
    to[w[i].from].push_back(w[i]);
  }
  for (int i = 1; i < n; i++) {
    w[i + n - 1].from = read();
    w[i + n - 1].pos = read();
    w[i + n - 1].v = read();
    toroot[w[i + n - 1].from] = w[i + n - 1].v;
  }
  dfs(1, 0, 1);
  tree1.Build1();
  tree2.Build2();
}
int lca(int u, int v) {
  if (deep[u] < deep[v]) swap(u, v);
  for (int i = 20; i >= 0; i--) {
    if (deep[anc[u][i]] >= deep[v]) {
      u = anc[u][i];
    }
  }
  if (u == v) return u;
  for (int i = 20; i >= 0; i--) {
    if (anc[u][i] && anc[v][i] && anc[u][i] != anc[v][i]) {
      u = anc[u][i];
      v = anc[v][i];
    }
  }
  return anc[u][0];
}
int main() {
  init();
  while (q--) {
    int op = read();
    int u = read();
    int v = read();
    if (op == 1) {
      if (u < n) {
        long long now = w[u].v;
        tree1.Update(l[w[u].pos], r[w[u].pos], v - now, 1);
        tree2.Update(l[w[u].pos], r[w[u].pos], v - now, 1);
        w[u].v = v;
      } else {
        long long now = toroot[w[u].from];
        tree1.Update(l[w[u].from], l[w[u].from], v - now, 1);
        toroot[w[u].from] = v;
      }
    } else {
      if (l[u] <= l[v] && r[u] >= r[v]) {
        long long du = tree2.Query(l[u], l[u], 1);
        long long dv = tree2.Query(l[v], l[v], 1);
        long long ans = 0;
        printf("%I64d\n", max(du - dv, dv - du));
      } else {
        long long ans = tree1.Query(l[u], r[u], 1) +
                        tree2.Query(l[v], l[v], 1) - tree2.Query(l[u], l[u], 1);
        printf("%I64d\n", ans);
      }
    }
  }
  return 0;
}
