/*
这是什么神仙题目QAQ
首先考虑在序列上的问题
先不考虑修改成白色, 一个白点能r被染成黑色 意味着能够找到一个l使得在l-r中的操作1次数大于等于
r - l + 1
我们把初始值覆盖成-1就相当于单点+1求最大后缀和了
然后覆盖成白色, 相当于在这个点减去一些值使得最后到达他的最大后缀是-1, 然后对子树进行覆盖
上树同理 树剖即可
*/
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
#include<queue>
#define pii pair<int, int>
#include<cmath>
#define ll long long
#define M 100010
#define mmp make_pair
using namespace std;
int read() {
int nm = 0, f = 1;
char c = getchar();
for(; !isdigit(c); c = getchar()) if(c == '-') f = -1;
for(; isdigit(c); c = getchar()) nm = nm * 10 + c - '0';
return nm * f;
}
int fa[M], sz[M], son[M], dfn[M], dft, top[M], deep[M], n, q;
vector<int> to[M];
#define ls now << 1
#define rs now << 1 | 1
#define lson l, mid, now << 1
#define rson mid + 1, r, now << 1 | 1
void dfs(int now, int f) {
deep[now] = deep[f] + 1;
sz[now] = 1;
for(int i = 0; i < to[now].size(); i++) {
int vj = to[now][i];
dfs(vj, now);
if(sz[son[now]] < sz[vj]) son[now] = vj;
sz[now] += sz[vj];
}
}
void dfs(int now) {
dfn[now] = ++dft;
if(son[now]) {
top[son[now]] = top[now];
dfs(son[now]);
}
for(int i = 0; i < to[now].size(); i++) {
int vj = to[now][i];
if(vj == son[now]) continue;
top[vj] = vj;
dfs(vj);
}
}
int len[M << 2], mx[M << 2], s[M << 2], laz[M << 2];
void pushup(int now) {
mx[now] = max(mx[rs], mx[ls] + s[rs]);
s[now] = s[ls] + s[rs];
}
void add(int now) {
laz[now] = 1;
mx[now] = -1, s[now] = -len[now];
}
void pushdown(int now) {
if(!laz[now]) return;
add(ls);
add(rs);
laz[now] = 0;
}
void build(int l, int r, int now) {
len[now] = r - l + 1;
if(l == r) {
mx[now] = s[now] = -1;
return;
}
int mid = (l + r) >> 1;
build(lson), build(rson);
pushup(now);
}
void modify(int l, int r, int now, int pl, int v) {
if(l > pl || r < pl) return;
if(l == r) {
mx[now] += v, s[now] += v;
return;
}
pushdown(now);
int mid = (l + r) >> 1;
modify(lson, pl, v), modify(rson, pl, v);
pushup(now);
}
void cover(int l, int r, int now, int ln, int rn) {
if(l > rn || r < ln) return;
if(l >= ln && r <= rn) {
add(now);
return;
}
pushdown(now);
int mid = (l + r) >> 1;
cover(lson, ln, rn), cover(rson, ln, rn);
pushup(now);
}
pair<int,int> biao, tmp;
pii operator + (pii a, pii b) {
return mmp(max(b.first, a.first + b.second), a.second + b.second);
}
pii que(int l, int r, int now, int ln, int rn) {
if(l >= ln && r <= rn) return mmp(mx[now], s[now]);
int mid = (l + r) >> 1;
pushdown(now);
if(rn <= mid) return que(lson, ln, rn);
if(ln > mid) return que(rson, ln, rn);
return que(lson, ln, rn) + que(rson, ln, rn);
}
int query(int x) {
tmp = biao;
for(; x; x = fa[top[x]]) {
tmp = que(1, n, 1, dfn[top[x]], dfn[x]) + tmp;
}
return tmp.first;
}
int main() {
biao = mmp(-0x3e3e3e3e, 0);
n = read(), q = read();
for(int i = 2; i <= n; i++) fa[i] = read(), to[fa[i]].push_back(i);
dfs(1, 1);
top[1] = 1;
dfs(1);
build(1, n, 1);
while(q--) {
int op = read(), x = read();
if(op == 1) {
modify(1, n, 1, dfn[x], 1);
}
if(op == 2) {
int t = query(x);
modify(1, n, 1, dfn[x], -(t + 1));
if(sz[x] > 1) cover(1, n, 1, dfn[x] + 1, dfn[x] + sz[x] - 1);
}
if(op == 3) {
puts(query(x) >= 0 ? "black" : "white");
}
}
return 0;
}