#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > Gr;
vector<bool> used;
vector<int> dfrom1;
vector<int> number;
vector<vector<int> > Trees;
vector<vector<int> > Paths;
int maxdepth = 0;
void dfs(int s, int depth, int path) {
  used[s] = true;
  dfrom1[s] = depth;
  int cnt = 0;
  for (int i = 0; i < Gr[s].size(); ++i) {
    if (!used[Gr[s][i]]) {
      Paths[cnt + path].push_back(Gr[s][i]);
      number[Gr[s][i]] = cnt + path;
      dfs(Gr[s][i], depth + 1, path + cnt);
      ++cnt;
    }
  }
  maxdepth = max(depth, maxdepth);
}
void initnewtree(int number, int size) { Trees[number].resize(4 * size + 1); }
void increasetree(int number, int ver, int l, int r, int L, int R, int value) {
  if (l > r) return;
  if (L == l && R == r) {
    Trees[number][ver] += value;
  } else {
    int M = (L + R) >> 1;
    increasetree(number, ver * 2, l, min(r, M), L, M, value);
    increasetree(number, ver * 2 + 1, max(M + 1, l), r, M + 1, R, value);
  }
}
int getit(int number, int ver, int l, int L, int R) {
  int res = 0;
  while (L != R) {
    res += Trees[number][ver];
    int m = (L + R) >> 1;
    if (l <= m) {
      ver <<= 1;
      R = m;
    } else {
      ver <<= 1;
      ++ver;
      L = m + 1;
    }
  }
  return res + Trees[number][ver];
}
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  Gr.resize(n + 1);
  Paths.resize(n + 1);
  number.resize(n + 1);
  used.resize(n + 1, false);
  dfrom1.resize(n + 1);
  Trees.resize(n + 1);
  for (int i = 0; i < n - 1; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    Gr[a].push_back(b);
    Gr[b].push_back(a);
  }
  dfs(1, 0, 1);
  Gr.clear();
  Trees[0].resize(4 * (maxdepth + 1) + 1);
  for (int i = 1; i <= n; ++i) initnewtree(i, Paths[i].size());
  for (int i = 0; i < q; ++i) {
    int t, v;
    scanf("%d%d", &t, &v);
    if (t == 0) {
      int x, d;
      scanf("%d%d", &x, &d);
      int Depth = dfrom1[v];
      if (v == 1)
        increasetree(0, 1, 0, min(maxdepth, d), 0, maxdepth, x);
      else {
        if (Depth <= d) {
          increasetree(0, 1, 0, min(maxdepth, d - Depth), 0, maxdepth, x);
          int l = d - Depth + 1;
          int r = min((int)Paths[number[v]].size(), Depth + d);
          if (l <= r) {
            increasetree(number[v], 1, l, r, 1, Paths[number[v]].size(), x);
          }
        } else {
          int l = max(1, Depth - d);
          int r = min((int)Paths[number[v]].size(), Depth + d);
          increasetree(number[v], 1, l, r, 1, Paths[number[v]].size(), x);
        }
      }
    } else {
      if (v == 1)
        printf("%d\n", getit(0, 1, 0, 0, maxdepth));
      else
        printf("%d\n",
               getit(0, 1, dfrom1[v], 0, maxdepth) +
                   getit(number[v], 1, dfrom1[v], 1, Paths[number[v]].size()));
    }
  }
  return 0;
}
