#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
struct Edge {
  int v, w, nxt;
} edge[N << 1];
struct Data {
  int u, v, w;
} e[N << 1];
int n, m, head[N], cnt, dis[N];
int dfn[N], ind, rnd[N], sz[N], up[N], dep[N];
int minn[N * 4], st[N * 4], tag[N * 4];
void add(int u, int v, int w) {
  edge[++cnt].v = v;
  edge[cnt].w = w;
  edge[cnt].nxt = head[u];
  head[u] = cnt;
}
void build(int u, int l, int r) {
  if (l == r) {
    minn[u] = dis[rnd[l]] + up[rnd[l]];
    st[u] = up[rnd[l]];
    return;
  }
  int mid = (l + r) / 2;
  build(u << 1, l, mid);
  build(u << 1 | 1, mid + 1, r);
  minn[u] = min(minn[u << 1], minn[u << 1 | 1]);
}
void pushdown(int u, int l, int r) {
  if (tag[u]) {
    minn[u << 1] += tag[u];
    st[u << 1] += tag[u];
    tag[u << 1] += tag[u];
    minn[u << 1 | 1] += tag[u];
    st[u << 1 | 1] += tag[u];
    tag[u << 1 | 1] += tag[u];
    tag[u] = 0;
  }
}
void update0(int u, int l, int r, int a, int b, int k) {
  if (a <= l && r <= b) {
    minn[u] += k;
    st[u] += k;
    tag[u] += k;
    return;
  }
  pushdown(u, l, r);
  int mid = (l + r) / 2;
  if (a <= mid) update0(u << 1, l, mid, a, b, k);
  if (mid < b) update0(u << 1 | 1, mid + 1, r, a, b, k);
  minn[u] = min(minn[u << 1], minn[u << 1 | 1]);
}
void update1(int u, int l, int r, int x, int k) {
  if (l == r) {
    minn[u] += k;
    return;
  }
  pushdown(u, l, r);
  int mid = (l + r) / 2;
  if (x <= mid)
    update1(u << 1, l, mid, x, k);
  else
    update1(u << 1 | 1, mid + 1, r, x, k);
  minn[u] = min(minn[u << 1], minn[u << 1 | 1]);
}
int query0(int u, int l, int r, int x) {
  if (l == r) return st[u];
  pushdown(u, l, r);
  int mid = (l + r) / 2;
  if (x <= mid)
    return query0(u << 1, l, mid, x);
  else
    return query0(u << 1 | 1, mid + 1, r, x);
}
int query1(int u, int l, int r, int a, int b) {
  if (a <= l && r <= b) return minn[u];
  pushdown(u, l, r);
  int mid = (l + r) / 2;
  int ans1 = 2e9, ans2 = 2e9;
  if (a <= mid) ans1 = query1(u << 1, l, mid, a, b);
  if (mid < b) ans2 = query1(u << 1 | 1, mid + 1, r, a, b);
  return min(ans1, ans2);
}
void dfs(int u) {
  dfn[u] = ++ind;
  rnd[ind] = u;
  sz[u] = 1;
  for (int i = head[u]; i; i = edge[i].nxt) {
    int v = edge[i].v;
    int w = edge[i].w;
    up[v] = up[u] + w;
    dep[v] = dep[u] + 1;
    dfs(v);
    sz[u] += sz[v];
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n - 1; i++) {
    scanf("%d%d%d", &e[i].u, &e[i].v, &e[i].w);
    add(e[i].u, e[i].v, e[i].w);
  }
  for (int i = n; i <= 2 * n - 2; i++) {
    scanf("%d%d%d", &e[i].u, &e[i].v, &e[i].w);
    dis[e[i].u] = e[i].w;
  }
  dfs(1);
  build(1, 1, n);
  int t, x, y;
  while (m--) {
    scanf("%d%d%d", &t, &x, &y);
    if (t == 1) {
      if (x <= n - 1) {
        int u = e[x].u, v = e[x].v;
        if (dep[u] < dep[v]) swap(u, v);
        update0(1, 1, n, dfn[u], dfn[u] + sz[u] - 1, -e[x].w + y);
        e[x].w = y;
      } else
        update1(1, 1, n, dfn[e[x].u], -e[x].w + y);
      e[x].w = y;
      dis[e[x].u] = y;
    } else {
      int up_x = query0(1, 1, n, dfn[x]);
      int up_y = query0(1, 1, n, dfn[y]);
      if (dfn[x] <= dfn[y] && dfn[y] <= dfn[x] + sz[x] - 1)
        printf("%d\n", up_y - up_x);
      else {
        printf("%d\n",
               query1(1, 1, n, dfn[x], dfn[x] + sz[x] - 1) - up_x + up_y);
      }
    }
  }
  return 0;
}
