#include <bits/stdc++.h>
using namespace std;
vector<int> second[100005], rnd(4 * 100005);
void increase(int b, int e, int val, vector<int> &v, int id, int l, int r) {
  if (b >= r || e <= l) return;
  if (l >= b && r <= e) {
    v[id] += val;
    return;
  }
  int mid = (l + r) >> 1;
  increase(b, e, val, v, 2 * id, l, mid);
  increase(b, e, val, v, 2 * id + 1, mid, r);
  return;
}
int getval(int pos, vector<int> &v, int id, int l, int r) {
  if (r - l < 2) return v[id];
  int mid = (l + r) >> 1;
  if (pos < mid) return v[id] + getval(pos, v, 2 * id, l, mid);
  return v[id] + getval(pos, v, 2 * id + 1, mid, r);
}
int lvl[100005];
vector<int> graph[100005];
int line[100005], ln, len[100005];
void go(int now, int l, int from) {
  len[ln]++;
  lvl[now] = l;
  line[now] = ln;
  int i;
  for (i = 0; i < graph[now].size(); i++) {
    int to = graph[now][i];
    if (to == from) continue;
    go(to, l + 1, now);
  }
  return;
}
int main() {
  int n, q, i;
  scanf("%d", &n);
  scanf("%d", &q);
  for (i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d", &u);
    scanf("%d", &v);
    u--;
    v--;
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
  for (i = 0; i < graph[0].size(); i++) {
    ln = i;
    len[i] = 1;
    go(graph[0][i], 1, 0);
    second[i] = vector<int>(4 * len[i]);
  }
  for (i = 0; i < q; i++) {
    int type, v;
    scanf("%d", &type);
    scanf("%d", &v);
    v--;
    int nowline = line[v], nowlevel = lvl[v];
    if (type == 0) {
      int x, d;
      scanf("%d", &x);
      scanf("%d", &d);
      if (d < nowlevel) {
        increase(nowlevel - d, min(nowlevel + d + 1, len[nowline]), x,
                 second[nowline], 1, 0, len[nowline]);
      } else {
        increase(0, d - nowlevel + 1, x, rnd, 1, 0, 100005 - 2);
        if (min(nowlevel + d + 1, len[nowline]) > d - nowlevel + 1) {
          assert(v);
          increase(d - nowlevel + 1, min(nowlevel + d + 1, len[nowline]), x,
                   second[nowline], 1, 0, len[nowline]);
        }
      }
    } else {
      printf("%d\n", getval(nowlevel, rnd, 1, 0, 100005 - 2) +
                         getval(nowlevel, second[nowline], 1, 0, len[nowline]));
    }
  }
  return 0;
}
