#include <bits/stdc++.h>
using namespace std;
const int MaxN = 200003;
int n, q;
struct Edge {
  int u, v, w;
} edge[MaxN * 2];
vector<pair<int, int> > e[MaxN];
int fa[MaxN], dep[MaxN], sz[MaxN], id[MaxN], idx;
long long dist[MaxN], weight[MaxN];
void dfs(int x) {
  id[x] = ++idx;
  for (pair<int, int>& i : e[x]) {
    int v = i.first, w = i.second;
    dfs(v);
  }
}
void dfs2(int x) {
  sz[id[x]] = 1;
  for (pair<int, int>& i : e[x]) {
    int v = i.first, w = i.second;
    dist[id[v]] = dist[id[x]] + w;
    dfs2(v);
    sz[id[x]] += sz[id[v]];
  }
}
namespace MinSegTree {
long long mn[MaxN << 2], adds[MaxN << 2];
void build(int p, int l, int r) {
  if (l == r) {
    mn[p] = dist[l] + weight[l];
    adds[p] = 0;
    return;
  }
  int mid = (l + r) / 2;
  build(p * 2, l, mid);
  build(p * 2 + 1, mid + 1, r);
  mn[p] = min(mn[p * 2], mn[p * 2 + 1]);
  adds[p] = 0;
}
inline void init() { build(1, 1, n); }
inline void pushdown(int p, int l, int r) {
  mn[p] += adds[p];
  if (l < r) {
    adds[p * 2] += adds[p];
    adds[p * 2 + 1] += adds[p];
  }
  adds[p] = 0;
}
inline void update(int p, int l, int r) {
  pushdown(p, l, r);
  if (l < r) {
    mn[p] = min(mn[p * 2] + adds[p * 2], mn[p * 2 + 1] + adds[p * 2 + 1]);
  }
}
void add(long long s, int p, int l, int r, int ll, int rr) {
  if (ll <= l && r <= rr) {
    adds[p] += s;
    return;
  }
  pushdown(p, l, r);
  int mid = (l + r) / 2;
  if (ll <= mid) add(s, p * 2, l, mid, ll, rr);
  if (rr > mid) add(s, p * 2 + 1, mid + 1, r, ll, rr);
  update(p, l, r);
}
long long query(int p, int l, int r, int ll, int rr) {
  if (ll <= l && r <= rr) {
    return mn[p] + adds[p];
  }
  pushdown(p, l, r);
  long long ret = 0x7f7f7f7f7f7f7f7fLL;
  int mid = (l + r) / 2;
  if (ll <= mid) ret = min(ret, query(p * 2, l, mid, ll, rr));
  if (rr > mid) ret = min(ret, query(p * 2 + 1, mid + 1, r, ll, rr));
  return ret;
}
}  // namespace MinSegTree
namespace DistSegTree {
long long s[MaxN << 2];
void build(int p, int l, int r) {
  if (l == r) {
    s[p] = dist[l];
    return;
  }
  int mid = (l + r) / 2;
  build(p * 2, l, mid);
  build(p * 2 + 1, mid + 1, r);
}
inline void init() { build(1, 1, n); }
inline void pushdown(int p) {
  s[p * 2] += s[p];
  s[p * 2 + 1] += s[p];
  s[p] = 0;
}
void add(int x, int p, int l, int r, int ll, int rr) {
  if (ll <= l && r <= rr) {
    s[p] += x;
    return;
  }
  pushdown(p);
  int mid = (l + r) / 2;
  if (ll <= mid) add(x, p * 2, l, mid, ll, rr);
  if (rr > mid) add(x, p * 2 + 1, mid + 1, r, ll, rr);
}
inline long long query(int x, int p, int l, int r) {
  if (l == r) return s[p];
  pushdown(p);
  int mid = (l + r) / 2;
  if (x <= mid)
    return query(x, p * 2, l, mid);
  else
    return query(x, p * 2 + 1, mid + 1, r);
}
}  // namespace DistSegTree
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i < n; ++i) {
    int u, v, w;
    scanf("%d%d%d", &u, &v, &w);
    edge[i].u = u, edge[i].v = v, edge[i].w = w;
    e[u].emplace_back(v, w);
  }
  fa[1] = 1, dep[1] = 0, dist[1] = 0, weight[1] = 0;
  dfs(1);
  dfs2(1);
  for (int i = n; i <= 2 * n - 2; ++i) {
    int u, v, w;
    scanf("%d%d%d", &u, &v, &w);
    edge[i].u = u, edge[i].v = v, edge[i].w = w;
    weight[id[u]] = w;
  }
  MinSegTree::init();
  DistSegTree::init();
  for (int i = 1; i <= q; ++i) {
    int type;
    scanf("%d", &type);
    if (type == 1) {
      int pos, x;
      scanf("%d%d", &pos, &x);
      if (pos < n) {
        int change = x - edge[pos].w;
        int l = id[edge[pos].v], r = l + sz[l] - 1;
        MinSegTree::add(change, 1, 1, n, l, r);
        DistSegTree::add(change, 1, 1, n, l, r);
        edge[pos].w = x;
      } else {
        int change = x - edge[pos].w;
        int l = id[edge[pos].u], r = l + sz[l] - 1;
        MinSegTree::add(change, 1, 1, n, l, l);
        edge[pos].w = x;
      }
    } else {
      int u, v;
      scanf("%d%d", &u, &v);
      int l = id[u], r = l + sz[l] - 1;
      long long ans;
      if (l <= id[v] && id[v] <= r) {
        ans = DistSegTree::query(id[v], 1, 1, n) -
              DistSegTree::query(id[u], 1, 1, n);
      } else {
        ans = MinSegTree::query(1, 1, n, l, r) -
              DistSegTree::query(id[u], 1, 1, n) +
              DistSegTree::query(id[v], 1, 1, n);
      }
      printf("%lld\n", ans);
    }
  }
  return 0;
}
