#include <bits/stdc++.h>
using namespace std;
int n, Q;
int U[200005 << 1], V[200005 << 1], W[200005 << 1];
int to[200005], nxt[200005], hd[200005], val[200005], cnte;
void add(int u, int v, int w) {
  to[++cnte] = v;
  val[cnte] = w;
  nxt[cnte] = hd[u];
  hd[u] = cnte;
}
int E_Rt[200005];
int dep[200005], fa[200005], sz[200005], son[200005], top[200005];
long long dis[200005];
void dfs(int x, int f) {
  dep[x] = dep[f] + 1;
  fa[x] = f;
  sz[x] = 1;
  for (int i = hd[x], y; i; i = nxt[i]) {
    y = to[i];
    if (y == f) continue;
    dis[y] = dis[x] + val[i];
    dfs(y, x);
    sz[x] += sz[y];
    if (sz[y] > sz[son[x]]) son[x] = y;
  }
}
int L[200005], R[200005], ID[200005], tot;
void redfs(int x, int tp) {
  L[x] = ++tot;
  ID[tot] = x;
  top[x] = tp;
  if (son[x]) redfs(son[x], tp);
  for (int i = hd[x], y; i; i = nxt[i]) {
    y = to[i];
    if (y == fa[x] || y == son[x]) continue;
    redfs(y, y);
  }
  R[x] = tot;
}
int LCA(int u, int v) {
  while (top[u] != top[v]) {
    if (dep[top[u]] < dep[top[v]]) swap(u, v);
    u = fa[top[u]];
  }
  return dep[u] < dep[v] ? u : v;
}
long long mi[200005 << 2], lazy[200005 << 2];
void build(int L = 1, int R = n, int p = 1) {
  if (L == R) {
    mi[p] = dis[ID[L]] + E_Rt[ID[L]];
    return;
  }
  int mid = L + R >> 1;
  build(L, mid, p << 1);
  build(mid + 1, R, p << 1 | 1);
  mi[p] = min(mi[p << 1], mi[p << 1 | 1]);
}
void down(int p) {
  if (lazy[p]) {
    mi[p << 1] += lazy[p];
    mi[p << 1 | 1] += lazy[p];
    lazy[p << 1] += lazy[p];
    lazy[p << 1 | 1] += lazy[p];
    lazy[p] = 0;
  }
}
void update(int ql, int qr, int a, int L = 1, int R = n, int p = 1) {
  if (ql <= L && R <= qr) {
    mi[p] += a;
    lazy[p] += a;
    return;
  }
  down(p);
  int mid = L + R >> 1;
  if (qr <= mid)
    update(ql, qr, a, L, mid, p << 1);
  else if (ql > mid)
    update(ql, qr, a, mid + 1, R, p << 1 | 1);
  else
    update(ql, mid, a, L, mid, p << 1),
        update(mid + 1, qr, a, mid + 1, R, p << 1 | 1);
  mi[p] = min(mi[p << 1], mi[p << 1 | 1]);
}
long long query(int ql, int qr, int L = 1, int R = n, int p = 1) {
  if (ql <= L && R <= qr) return mi[p];
  down(p);
  int mid = L + R >> 1;
  if (qr <= mid)
    return query(ql, qr, L, mid, p << 1);
  else if (ql > mid)
    return query(ql, qr, mid + 1, R, p << 1 | 1);
  else
    return min(query(ql, mid, L, mid, p << 1),
               query(mid + 1, qr, mid + 1, R, p << 1 | 1));
}
void solve() {
  cin >> n >> Q;
  for (int i = 1; i < n; ++i) {
    scanf("%d%d%d", &U[i], &V[i], &W[i]);
    add(U[i], V[i], W[i]);
  }
  for (int i = n, u, v; i <= 2 * n - 2; ++i) {
    scanf("%d%d%d", &U[i], &V[i], &W[i]);
    E_Rt[U[i]] = W[i];
  }
  dfs(1, 0);
  redfs(1, 1);
  build();
  int opt, x, y, u, v, lca;
  long long dis_lca, dis_x, dis_y, res;
  while (Q--) {
    scanf("%d%d%d", &opt, &x, &y);
    if (opt == 1) {
      if (x >= n) {
        u = U[x];
        update(L[u], L[u], y - E_Rt[u]);
        E_Rt[u] = y;
      } else {
        u = U[x];
        v = V[x];
        if (dep[u] < dep[v]) swap(u, v);
        update(L[u], R[u], y - W[x]);
        W[x] = y;
      }
    } else {
      lca = LCA(x, y);
      dis_lca = query(L[lca], L[lca]) - E_Rt[lca];
      dis_x = query(L[x], L[x]) - E_Rt[x];
      dis_y = query(L[y], L[y]) - E_Rt[y];
      res = dis_y - dis_lca;
      if (x != lca) res += query(L[x], R[x]) - dis_x + dis_lca;
      printf("%lld\n", res);
    }
  }
}
int main() {
  solve();
  fclose(stdin);
  fclose(stdout);
  return 0;
}
