#include <bits/stdc++.h>
using namespace std;
const int N = 150100;
const int mod = 998244353;
vector<int> p[N];
vector<int> szs[N];
vector<pair<int, int> > pr[N];
vector<int> qu[N];
int res[N];
bool vis[N];
int sz[N], ty[N];
int n, q;
void init(int x, int pp = 0) {
  sz[x] = 1;
  szs[x].resize(p[x].size());
  for (int i = 0; i < p[x].size(); i++) {
    int y = p[x][i];
    if (y == pp) continue;
    init(y, x);
    sz[x] += sz[y];
    szs[x][i] = sz[y];
  }
  for (int i = 0; i < p[x].size(); i++) {
    int y = p[x][i];
    if (y != pp) continue;
    szs[x][i] = n - sz[x];
  }
}
int getSz(int x, int pp = 0) {
  if (vis[x]) return 0;
  int sz = 1;
  for (int i = 0; i < p[x].size(); i++) {
    int y = p[x][i];
    if (y == pp) continue;
    sz += getSz(y, x);
  }
  return sz;
}
int getCen(int x, int allSz, int &cen, int pp = 0) {
  if (vis[x]) return 0;
  int sz = 1;
  int mx = 0;
  for (int i = 0; i < p[x].size(); i++) {
    int y = p[x][i];
    if (y == pp) continue;
    int ch = getCen(y, allSz, cen, x);
    mx = max(mx, ch);
    sz += ch;
  }
  mx = max(mx, allSz - sz);
  if (mx <= allSz / 2) cen = x;
  return sz;
}
int bit[N];
void add(int in, int val) {
  in++;
  while (in < N) {
    bit[in] += val;
    if (bit[in] >= mod) bit[in] -= mod;
    in += in & (-in);
  }
}
int cal(int in) {
  in++;
  int res = 0;
  while (in > 0) {
    res += bit[in];
    if (res >= mod) res -= mod;
    in -= in & (-in);
  }
  return res;
}
void addToBIT(int x, int val, int pp) {
  if (vis[x]) return;
  int sz = 0;
  for (int i = 0; i < p[x].size(); i++) {
    int y = p[x][i];
    if (y == pp) {
      sz = n - szs[x][i];
      continue;
    }
    addToBIT(y, val, x);
  }
  for (int i = 0; i < pr[x].size(); i++) {
    int64_t d = pr[x][i].second;
    int tim = pr[x][i].first;
    d *= sz;
    d *= val;
    d %= mod;
    if (d < 0) d += mod;
    add(tim, d);
  }
}
void calFromBIT(int x, int64_t val, int pp = 0) {
  if (vis[x]) return;
  for (int i = 0; i < p[x].size(); i++) {
    int y = p[x][i];
    if (y == pp) {
      continue;
    }
    calFromBIT(y, val, x);
  }
  for (int i = 0; i < qu[x].size(); i++) {
    res[qu[x][i]] += (cal(qu[x][i]) * val) % mod;
    res[qu[x][i]] %= mod;
  }
}
void div(int x) {
  int sz = getSz(x);
  int cen;
  getCen(x, sz, cen);
  vis[cen] = 1;
  x = cen;
  for (int i = 0; i < p[x].size(); i++) {
    int y = p[x][i];
    if (vis[y]) continue;
    div(y);
  }
  for (int i = 0; i < p[x].size(); i++) {
    int y = p[x][i];
    if (vis[y]) continue;
    addToBIT(y, 1, x);
  }
  for (int i = 0; i < qu[x].size(); i++) {
    res[qu[x][i]] += cal(qu[x][i]);
    res[qu[x][i]] %= mod;
  }
  for (int i = 0; i < p[x].size(); i++) {
    int y = p[x][i];
    if (vis[y]) continue;
    addToBIT(y, -1, x);
    calFromBIT(y, 1);
    addToBIT(y, 1, x);
  }
  for (int i = 0; i < p[x].size(); i++) {
    int y = p[x][i];
    if (vis[y]) continue;
    addToBIT(y, -1, x);
  }
  for (int i = 0; i < pr[x].size(); i++) {
    int64_t d = pr[x][i].second;
    int tim = pr[x][i].first;
    add(tim, d);
  }
  for (int i = 0; i < p[x].size(); i++) {
    int y = p[x][i];
    if (vis[y]) continue;
    calFromBIT(y, n - szs[x][i], x);
  }
  for (int i = 0; i < pr[x].size(); i++) {
    int64_t d = pr[x][i].second;
    int tim = pr[x][i].first;
    d *= -1;
    d %= mod;
    d += mod;
    add(tim, d);
  }
  vis[cen] = 0;
}
int pre[N];
int64_t pw(int64_t x, int64_t p) {
  if (!p) return 1;
  int64_t z = pw(x, p / 2);
  z *= z;
  z %= mod;
  if (p % 2 == 0) return z;
  z *= x;
  z %= mod;
  return z;
}
int main() {
  cin >> n >> q;
  int x, y;
  for (int i = 0; i < n - 1; i++) {
    scanf("%d%d", &x, &y);
    p[x].push_back(y);
    p[y].push_back(x);
  }
  int v, d;
  for (int i = 0; i < q; i++) {
    scanf("%d%d", &ty[i], &v);
    if (ty[i] == 1) {
      scanf("%d", &d);
      pr[v].push_back({i, d});
      pre[v] += ((int64_t)d * n) % mod;
      if (pre[v] >= mod) pre[v] -= mod;
    } else {
      res[i] += pre[v];
      if (res[i] >= mod) res[i] -= mod;
      qu[v].push_back(i);
    }
  }
  init(1);
  div(1);
  for (int i = 0; i < q; i++) {
    if (ty[i] == 2) {
      res[i] = ((int64_t)res[i] * pw(n, mod - 2)) % mod;
      res[i] %= mod;
      printf("%d\n", res[i]);
    }
  }
  return 0;
}
