Problem: You have two rooted undirected trees, each contains n vertices. Let's number the vertices of each tree with integers from 1 to n. The root of each tree is at vertex 1. The edges of the first tree are painted blue, the edges of the second one are painted red. For simplicity, let's say that the first tree is blue and the second tree is red.

Edge {x, y} is called bad for edge {p, q} if two conditions are fulfilled: 

  1. The color of edge {x, y} is different from the color of edge {p, q}. 
  2. Let's consider the tree of the same color that edge {p, q} is. Exactly one of vertices x, y lies both in the subtree of vertex p and in the subtree of vertex q. 



In this problem, your task is to simulate the process described below. The process consists of several stages:

  1. On each stage edges of exactly one color are deleted. 
  2. On the first stage, exactly one blue edge is deleted. 
  3. Let's assume that at the stage i we've deleted edges {u1, v1}, {u2, v2}, ..., {uk, vk}. At the stage i + 1 we will delete all undeleted bad edges for edge {u1, v1}, then we will delete all undeleted bad edges for edge {u2, v2} and so on until we reach edge {uk, vk}. 



For each stage of deleting edges determine what edges will be removed on the stage. Note that the definition of a bad edge always considers the initial tree before it had any edges removed.

Input

The first line contains integer n (2 ≤ n ≤ 2·105) — the number of vertices in each tree.

The next line contains n - 1 positive integers a2, a3, ..., an (1 ≤ ai ≤ n; ai ≠ i) — the description of edges of the first tree. Number ai means that the first tree has an edge connecting vertex ai and vertex i.

The next line contains n - 1 positive integers b2, b3, ..., bn (1 ≤ bi ≤ n; bi ≠ i) — the description of the edges of the second tree. Number bi means that the second tree has an edge connecting vertex bi and vertex i. 

The next line contains integer idx (1 ≤ idx < n) — the index of the blue edge that was removed on the first stage. Assume that the edges of each tree are numbered with numbers from 1 to n - 1 in the order in which they are given in the input. 

Output

For each stage of removing edges print its description. Each description must consist of exactly two lines. If this is the stage when blue edges are deleted, then the first line of the description must contain word Blue, otherwise — word Red. In the second line print the indexes of the edges that will be deleted on this stage in the increasing order.

Examples

Input

5
1 1 1 1
4 2 1 1
3


Output

Blue
3
Red
1 3
Blue
1 2
Red
2

Note

For simplicity let's assume that all edges of the root tree received some direction, so that all vertices are reachable from vertex 1. Then a subtree of vertex v is a set of vertices reachable from vertex v in the resulting directed graph (vertex v is also included in the set).

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
int totb = 0, totr = 0, totx = 0, deep;
int n;
struct data {
  int next, num;
} edgeb[400001], edger[400001];
struct data2 {
  int x;
  bool judge;
} ans[200001];
struct seg {
  int l, r, va;
} tr[2000001], tb[2000001];
int headb[200001], headr[200001];
int wb[200001], wr[200001], vr[200001], vb[200001], db[200001], dr[200001];
int fab[200001][21], far[200001][21], lb[200001], rb[200001], lr[200001],
    rr[200001];
int eb[200001], er[200001], vab[400001], var[400001], locb[400001],
    locr[400001], px;
bool visb[200001], visr[200001];
queue<data2> q;
bool cmp(data2 p, data2 q) { return p.x < q.x; }
void add1(int u, int v) {
  edgeb[++totb].next = headb[u];
  edgeb[totb].num = v;
  headb[u] = totb;
}
void add2(int u, int v) {
  edger[++totr].next = headr[u];
  edger[totr].num = v;
  headr[u] = totr;
}
void dfsb1(int x) {
  wb[x] = vb[x];
  db[x] = deep;
  lb[x] = totx + 1;
  totx += wb[x];
  for (int i = headb[x]; i != -1; i = edgeb[i].next) {
    int kx = edgeb[i].num;
    if (!db[kx]) {
      deep++;
      fab[kx][0] = x;
      dfsb1(kx);
      deep--;
      wb[x] += wb[kx];
    }
  }
  rb[x] = totx;
}
void dfsr1(int x) {
  wr[x] = vr[x];
  dr[x] = deep;
  lr[x] = totx + 1;
  totx += wr[x];
  for (int i = headr[x]; i != -1; i = edger[i].next) {
    int kx = edger[i].num;
    if (!dr[kx]) {
      deep++;
      far[kx][0] = x;
      dfsr1(kx);
      deep--;
      wr[x] += wr[kx];
    }
  }
  rr[x] = totx;
}
void build(int i, int l, int r) {
  tr[i].l = tb[i].l = l;
  tr[i].r = tb[i].r = r;
  if (l == r) {
    tb[i].va = vab[l];
    tr[i].va = var[l];
    if (locr[l] == px) tr[i].va = INF;
    return;
  }
  int mid = (l + r) / 2;
  build(i * 2, l, mid);
  build(i * 2 + 1, mid + 1, r);
  tr[i].va = min(tr[i * 2].va, tr[i * 2 + 1].va);
  tb[i].va = min(tb[i * 2].va, tb[i * 2 + 1].va);
}
void deleb(int i, int l, int r, int va) {
  int nowl = tb[i].l, nowr = tb[i].r;
  if (nowl > r || nowr < l) return;
  if (tb[i].va > va) return;
  if (nowl == nowr) {
    tb[i].va = INF;
    if (visb[locb[nowl]]) return;
    tb[i].va = INF;
    data2 now;
    now.x = locb[nowl];
    now.judge = 1;
    q.push(now);
    visb[now.x] = 1;
    return;
  }
  deleb(i * 2, l, r, va);
  deleb(i * 2 + 1, l, r, va);
  tb[i].va = min(tb[i * 2].va, tb[i * 2 + 1].va);
}
void deler(int i, int l, int r, int va) {
  int nowl = tr[i].l, nowr = tr[i].r;
  if (nowl > r || nowr < l) return;
  if (tr[i].va > va) return;
  if (nowl == nowr) {
    tr[i].va = INF;
    if (visr[locr[nowl]]) return;
    data2 now;
    now.x = locr[nowl];
    now.judge = 0;
    q.push(now);
    visr[now.x] = 1;
    return;
  }
  deler(i * 2, l, r, va);
  deler(i * 2 + 1, l, r, va);
  tr[i].va = min(tr[i * 2].va, tr[i * 2 + 1].va);
}
void prelca() {
  fab[1][0] = far[1][0] = 1;
  for (int j = 1; j <= 20; j++)
    for (int i = 1; i <= n; i++) {
      far[i][j] = far[far[i][j - 1]][j - 1];
      fab[i][j] = fab[fab[i][j - 1]][j - 1];
    }
}
int lcab(int u, int v) {
  while (db[u] > db[v]) {
    int kx = log2(db[u] - db[v]);
    u = fab[u][kx];
  }
  while (db[u] < db[v]) {
    int kx = log2(db[v] - db[u]);
    v = fab[v][kx];
  }
  if (u == v) return u;
  for (int i = 20; i >= 0; i--) {
    if (fab[u][i] == fab[v][i]) continue;
    u = fab[u][i];
    v = fab[v][i];
  }
  return fab[u][0];
}
int lcar(int u, int v) {
  while (dr[u] > dr[v]) {
    int kx = log2(dr[u] - dr[v]);
    u = far[u][kx];
  }
  while (dr[u] < dr[v]) {
    int kx = log2(dr[v] - dr[u]);
    v = far[v][kx];
  }
  if (u == v) return u;
  for (int i = 20; i >= 0; i--) {
    if (far[u][i] == far[v][i]) continue;
    u = far[u][i];
    v = far[v][i];
  }
  return far[u][0];
}
void prep() {
  memset(headr, -1, sizeof(headr));
  memset(headb, -1, sizeof(headb));
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    scanf("%d", &eb[i]);
    add1(i, eb[i]);
    add1(eb[i], i);
  }
  for (int i = 2; i <= n; i++) {
    scanf("%d", &er[i]);
    add2(i, er[i]);
    add2(er[i], i);
  }
  for (int i = 2; i <= n; i++) {
    vr[i]++;
    vr[eb[i]]++;
    vb[i]++;
    vb[er[i]]++;
  }
  deep = 1;
  totx = 0;
  dfsb1(1);
  deep = 1;
  totx = 0;
  dfsr1(1);
  memset(vr, 0, sizeof(vr));
  memset(vb, 0, sizeof(vb));
  prelca();
  for (int i = 2; i <= n; i++) {
    vr[i]++;
    vr[eb[i]]++;
    var[vr[i] + lr[i] - 1] = var[vr[eb[i]] + lr[eb[i]] - 1] =
        dr[lcar(i, eb[i])];
    locr[vr[i] + lr[i] - 1] = locr[vr[eb[i]] + lr[eb[i]] - 1] = i - 1;
    vb[i]++;
    vb[er[i]]++;
    vab[vb[i] + lb[i] - 1] = vab[vb[er[i]] + lb[er[i]] - 1] =
        db[lcab(i, er[i])];
    locb[vb[i] + lb[i] - 1] = locb[vb[er[i]] + lb[er[i]] - 1] = i - 1;
  }
  scanf("%d", &px);
  build(1, 1, 2 * n - 2);
}
int getp(data2 x) {
  int i = x.x;
  if (x.judge == 0) {
    if (db[i + 1] < db[eb[i + 1]]) return eb[i + 1];
    return i + 1;
  }
  if (dr[i + 1] < dr[er[i + 1]]) return er[i + 1];
  return i + 1;
}
void work() {
  data2 gx;
  gx.judge = 0;
  gx.x = px;
  q.push(gx);
  visr[px] = 1;
  int headpx = 0;
  while (!q.empty()) {
    data2 k = q.front();
    ans[++headpx] = k;
    q.pop();
    int point = getp(k);
    if (k.judge == 0)
      deleb(1, lb[point], rb[point], db[point] - 1);
    else
      deler(1, lr[point], rr[point], dr[point] - 1);
  }
  printf("Blue\n%d", ans[1].x);
  for (int i = 2; i <= headpx; i++) {
    if (ans[i].judge != ans[i - 1].judge) {
      int nowj = i;
      while (nowj <= headpx && ans[nowj].judge == ans[i].judge) nowj++;
      sort(ans + i, ans + nowj, cmp);
      if (ans[i].judge == 0)
        printf("\nBlue\n");
      else
        printf("\nRed\n");
    }
    printf("%d ", ans[i].x);
  }
}
int main() {
  prep();
  work();
  return 0;
}