#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int B;
int n, pa[N], q, opt[N], opt_v[N];
vector<int> G[N];
int cur[N], col[N], clr[N], num[N], _col[N];
struct edge {
  int v, z0, len;
};
vector<edge> E[N];
void dfs_bd(int u, int pre = -1, int z0 = 0, int len = 0) {
  if (cur[u]) {
    if (pre != -1) E[pre].push_back((edge){u, z0, len});
    for (int v : G[u]) dfs_bd(v, u, 0, 0);
  } else {
    for (int v : G[u]) dfs_bd(v, pre, z0 + (!col[u]), len + 1);
  }
}
void col1(int u) {
  if (!col[u]) {
    col[u] = 1;
    return;
  }
  ++num[u];
  for (edge e : E[u])
    if (e.z0 < num[u]) col1(e.v);
}
void col2(int u) {
  clr[u] = 1;
  num[u] = col[u] = 0;
  for (edge& e : E[u]) e.z0 = e.len, col2(e.v);
}
void dfs_pd(int u, int num = 0, int clr = 0) {
  if (cur[u]) {
    num = ::num[u], clr |= ::clr[u];
  } else {
    if (clr) col[u] = 0;
    if (!col[u] && num) col[u] = 1, --num;
  }
  for (int v : G[u]) dfs_pd(v, num, clr);
}
int main() {
  cin >> n >> q;
  B = (int)(sqrt(n) + 0.5);
  for (int i = (2); i <= (n); ++i) cin >> pa[i], G[pa[i]].push_back(i);
  for (int st = 0, ti = B; st < q; st = ti, ti += B) {
    for (int i = 1; i <= n; ++i) {
      cur[i] = num[i] = clr[i] = 0;
      E[i].clear();
    }
    for (int i = st; i < ti && i < q; ++i) {
      cin >> opt[i] >> opt_v[i];
      cur[opt_v[i]] = 1;
    }
    dfs_bd(1);
    for (int i = st; i < ti && i < q; ++i) {
      if (opt[i] == 1) {
        col1(opt_v[i]);
      } else if (opt[i] == 2) {
        col2(opt_v[i]);
      } else {
        if (col[opt_v[i]])
          cout << "black\n";
        else
          cout << "white\n";
      }
    }
    dfs_pd(1);
  }
}
