#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > adj[400005];
int a[400005], b[400005], w[400005];
int anc[400005][20], depth[400005];
int ml[400005], mr[400005];
int pos = 1;
void dfs(int node, int p) {
  anc[node][0] = p;
  ml[node] = pos++;
  for (int i = 1; i < 20; ++i) {
    anc[node][i] = anc[anc[node][i - 1]][i - 1];
  }
  for (pair<int, int> edge : adj[node]) {
    int ch = edge.second;
    if (p == ch) {
      continue;
    }
    depth[ch] = depth[node] + 1;
    dfs(ch, node);
  }
  mr[node] = pos - 1;
}
bool isAncestor(int a, int b) {
  if (depth[a] > depth[b]) {
    return false;
  }
  int d = depth[b] - depth[a];
  for (int i = 0; i < 20; ++i) {
    if (d & (1 << i)) {
      b = anc[b][i];
    }
  }
  return a == b;
}
int id[400005], idw[400005];
void push(long long *seg, long long *lazy, int pos, int l, int r) {
  if (lazy[pos] != 0) {
    seg[pos] += lazy[pos];
    if (l != r) {
      lazy[pos * 2] += lazy[pos];
      lazy[pos * 2 + 1] += lazy[pos];
    }
    lazy[pos] = 0;
  }
}
void update(long long *seg, long long *lazy, int pos, int l, int r, int ql,
            int qr, int val) {
  push(seg, lazy, pos, l, r);
  if (r < ql || qr < l) {
    return;
  }
  if (ql <= l && r <= qr) {
    lazy[pos] = val;
    push(seg, lazy, pos, l, r);
    return;
  }
  int mid = (l + r) / 2;
  update(seg, lazy, pos * 2, l, mid, ql, qr, val);
  update(seg, lazy, pos * 2 + 1, mid + 1, r, ql, qr, val);
  seg[pos] = min(seg[pos * 2], seg[pos * 2 + 1]);
}
long long query(long long *seg, long long *lazy, int pos, int l, int r, int ql,
                int qr) {
  push(seg, lazy, pos, l, r);
  if (r < ql || qr < l) {
    return 1e18;
  }
  if (ql <= l && r <= qr) {
    return seg[pos];
  }
  int mid = (l + r) / 2;
  return min(query(seg, lazy, pos * 2, l, mid, ql, qr),
             query(seg, lazy, pos * 2 + 1, mid + 1, r, ql, qr));
}
long long seg[400005 * 4], lazy[400005 * 4], qq[400005 * 4], ww[400005 * 4];
int g[400005];
void solve() {
  int n, q;
  scanf("%d %d ", &n, &q);
  for (int i = 1; i <= n - 1; ++i) {
    scanf("%d %d %d ", &a[i], &b[i], &w[i]);
    adj[a[i]].push_back(make_pair(i, b[i]));
  }
  for (int i = n; i <= 2 * n - 2; ++i) {
    int x, y, z;
    scanf("%d %d %d ", &x, &y, &z);
    id[i] = x;
    idw[i] = z;
    g[x] = i;
  }
  dfs(1, 0);
  for (int i = 1; i <= n - 1; ++i) {
    update(seg, lazy, 1, 1, n, ml[b[i]], mr[b[i]], w[i]);
    update(qq, ww, 1, 1, n, ml[b[i]], mr[b[i]], w[i]);
  }
  for (int i = n; i <= 2 * n - 2; ++i) {
    update(qq, ww, 1, 1, n, ml[id[i]], ml[id[i]], idw[i]);
  }
  while (q--) {
    int type, x, y;
    scanf("%d %d %d ", &type, &x, &y);
    if (type == 1) {
      if (x <= n - 1) {
        int ch = b[x];
        update(seg, lazy, 1, 1, n, ml[ch], mr[ch], y - w[x]);
        update(qq, ww, 1, 1, n, ml[ch], mr[ch], y - w[x]);
        w[x] = y;
      } else {
        int ch = id[x];
        update(qq, ww, 1, 1, n, ml[ch], ml[ch], y - idw[x]);
        idw[x] = y;
      }
    } else {
      long long ret = 0;
      if (isAncestor(x, y)) {
        ret = query(seg, lazy, 1, 1, n, ml[y], ml[y]) -
              query(seg, lazy, 1, 1, n, ml[x], ml[x]);
      } else {
        ret = query(qq, ww, 1, 1, n, ml[x], mr[x]) -
              query(seg, lazy, 1, 1, n, ml[x], ml[x]);
        ret += query(seg, lazy, 1, 1, n, ml[y], ml[y]);
      }
      printf("%lld\n", ret);
    }
  }
}
int main() {
  solve();
  return 0;
}
