#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int n, q, M, bl[N], vis[N], cc[N];
struct Que {
  int op, x;
} B[N];
struct TO {
  int to, d, t;
};
vector<TO> V[N];
vector<int> E[N];
void build(int x, int lst, int dep, int wh) {
  if (vis[x] && x > 1) V[lst].push_back((TO){x, dep, wh});
  for (auto y : E[x])
    if (vis[x])
      build(y, x, 1, 1);
    else
      build(y, lst, dep + 1, wh + 1 - bl[x]);
}
void dfs1(int x) {
  bl[x]++;
  for (auto &P : V[x])
    if (bl[x] >= P.t + 1) dfs1(P.to);
}
void dfs2(int x) {
  bl[x] = 0;
  for (auto &P : V[x]) P.t = P.d, dfs2(P.to);
  cc[x] = 1;
}
void Reset(int x, int blkdep, int cov) {
  if (!vis[x]) bl[x] = blkdep + (bl[x] && !cov);
  for (auto y : E[x]) Reset(y, max(0, bl[x] - 1), cov | cc[x]);
  bl[x] = min(1, bl[x]);
  if (vis[x]) V[x].clear(), vis[x] = cc[x] = 0;
}
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 2, x; i <= n; i++) scanf("%d", &x), E[x].push_back(i);
  for (int i = 1; i <= q; i++) scanf("%d%d", &B[i].op, &B[i].x);
  M = sqrt(q);
  for (int b = 1, l = 0, r = 0; r < q; b++) {
    l = (b - 1) * M + 1;
    r = min(l + M - 1, q);
    for (int i = l; i <= r; i++) vis[B[i].x] = 1;
    vis[1] = 1;
    build(1, 1, 0, 0);
    for (int i = l; i <= r; i++) {
      if (B[i].op == 1)
        dfs1(B[i].x);
      else if (B[i].op == 2)
        dfs2(B[i].x);
      else
        printf("%s\n", bl[B[i].x] ? "black" : "white");
    }
    Reset(1, 0, cc[1]);
  }
}
