#include <bits/stdc++.h>
using namespace std;
const int N = 200000 + 10;
const long long INF = 1e18;
int n, q;
struct Edge {
  int u, v;
  long long w;
  Edge(int _u = 0, int _v = 0, long long _w = 0) : u(_u), v(_v), w(_w) {}
};
vector<Edge> E;
int E_size;
vector<int> G[N];
int ptr[2 * N];
void adjListInit(int l, int r) {
  E.clear();
  E_size = 0;
  for (int i = l; i <= r; i++) G[i].clear();
}
void addEdge(int u, int v, long long w, int i) {
  E.push_back(Edge(u, v, w));
  E_size++;
  ptr[i] = E_size - 1;
  G[u].push_back(E_size - 1);
}
vector<Edge> Eback;
int Gback[N];
int Eback_size;
long long dist[N];
int in[N], out[N];
int peg[N];
int dfs_clock;
inline void dfsInit() {
  dist[1] = 0;
  dfs_clock = 0;
}
void dfs(int u, int pre) {
  in[u] = ++dfs_clock;
  peg[in[u]] = u;
  for (int i = 0; i < G[u].size(); i++) {
    Edge e = E[G[u][i]];
    int v = e.v;
    if (v == pre) continue;
    dist[v] = dist[u] + e.w;
    dfs(v, u);
  }
  out[u] = dfs_clock;
}
struct Node {
  int l, r;
  long long val, lazy;
  void update(long long x) { val += x, lazy += x; }
} node[N << 2];
inline void pushdown(int rt) {
  if (node[rt].lazy) {
    node[rt << 1].update(node[rt].lazy);
    node[rt << 1 | 1].update(node[rt].lazy);
    node[rt].lazy = 0;
  }
}
inline void pushup(int rt) {
  node[rt].val = min(node[rt << 1].val, node[rt << 1 | 1].val);
}
void build(int root, int l, int r) {
  node[root].l = l;
  node[root].r = r;
  node[root].val = 0;
  node[root].lazy = 0;
  if (l == r) {
    int p = peg[l];
    node[root].val = dist[p] + Eback[Gback[p]].w;
  } else {
    int mid = l + (r - l) / 2;
    build(root * 2, l, mid);
    build(root * 2 + 1, mid + 1, r);
    pushup(root);
  }
}
void update(int root, int st, int ed, int val) {
  if (st > node[root].r || ed < node[root].l) return;
  if (st <= node[root].l && node[root].r <= ed)
    node[root].update(val);
  else {
    pushdown(root);
    update(root * 2, st, ed, val);
    update(root * 2 + 1, st, ed, val);
    pushup(root);
  }
}
long long query(int root, int st, int ed) {
  if (ed < node[root].l || node[root].r < st) return INF;
  if (st <= node[root].l && node[root].r <= ed)
    return node[root].val;
  else {
    pushdown(root);
    long long lson = query(root * 2, st, ed);
    long long rson = query(root * 2 + 1, st, ed);
    pushup(root);
    return min(lson, rson);
  }
}
int main() {
  cin >> n >> q;
  adjListInit(1, n);
  for (int i = 1; i <= n - 1; i++) {
    int a, b;
    long long c;
    scanf("%d%d%I64d", &a, &b, &c);
    addEdge(a, b, c, i);
  }
  dfsInit();
  dfs(1, -1);
  Eback.clear();
  Eback_size = 0;
  for (int i = n, a, b, c; i <= 2 * n - 2; i++) {
    scanf("%d%d%d", &a, &b, &c);
    Eback.push_back(Edge(a, b, c));
    Eback_size++;
    ptr[i] = Eback_size - 1;
    Gback[a] = Eback_size - 1;
  }
  Eback.push_back(Edge(1, 1, 0));
  Eback_size++;
  Gback[1] = Eback_size - 1;
  build(1, 1, n);
  for (int i = 1, type; i <= q; i++) {
    scanf("%d", &type);
    if (type == 1) {
      int id;
      long long w;
      scanf("%d%I64d", &id, &w);
      if (id < n) {
        Edge &e = E[ptr[id]];
        update(1, in[e.v], out[e.v], w - e.w);
        e.w = w;
      } else {
        Edge &e = Eback[ptr[id]];
        update(1, in[e.u], in[e.u], w - e.w);
        e.w = w;
      }
    }
    if (type == 2) {
      int u, v;
      scanf("%d%d", &u, &v);
      if (in[u] <= in[v] && in[v] <= out[u]) {
        long long du = query(1, in[u], in[u]) - Eback[Gback[u]].w;
        long long dv = query(1, in[v], in[v]) - Eback[Gback[v]].w;
        printf("%I64d\n", dv - du);
      } else {
        long long ans = query(1, in[u], out[u]);
        long long du = query(1, in[u], in[u]) - Eback[Gback[u]].w;
        long long dv = query(1, in[v], in[v]) - Eback[Gback[v]].w;
        ans -= du;
        ans += dv;
        printf("%I64d\n", ans);
      }
    }
  }
}
