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;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return x * f;
}
const int MAXN = 400010;
const int INF = 2147483600;
int N;
int top[2], sta[2][MAXN + 1];
int tm;
int vis[2][MAXN + 1];
int nwt;
int tfa[2][MAXN + 1];
struct data {
  int mx[MAXN << 2], mn[MAXN << 2];
  int head[MAXN + 1], tail[MAXN + 1];
  vector<pair<int, int> > vec[MAXN + 1];
  int fa[MAXN + 1], Node[MAXN << 1], Next[MAXN << 1], Root[MAXN + 1], cnt;
  int nd;
  inline void insert(int u, int v) {
    Node[++cnt] = v;
    Next[cnt] = Root[u];
    Root[u] = cnt;
  }
  int dfn[MAXN + 1], L[MAXN + 1], R[MAXN + 1];
  int tim;
  inline void dfs(int k, int Fa) {
    dfn[k] = ++tim;
    L[k] = tim;
    for (int x = Root[k]; x; x = Next[x]) {
      int v = Node[x];
      if (v == Fa) continue;
      dfs(v, k);
    }
    R[k] = tim;
  }
  inline void update(int rt) {
    mx[rt] = max(mx[rt << 1], mx[rt << 1 | 1]);
    mn[rt] = min(mn[rt << 1], mn[rt << 1 | 1]);
  }
  inline void Calc(int rt, int l) {
    if (head[l] > tail[l]) {
      mn[rt] = INF;
      mx[rt] = -INF;
    } else
      mn[rt] = vec[l][head[l]].first, mx[rt] = vec[l][tail[l]].first;
    return;
  }
  inline void buildT(int rt, int l, int r) {
    if (l == r) {
      head[l] = 0;
      tail[l] = vec[l].size() - 1;
      Calc(rt, l);
      return;
    }
    int mid = (l + r) >> 1;
    buildT(rt << 1, l, mid);
    buildT(rt << 1 | 1, mid + 1, r);
    update(rt);
  }
  inline void Del(int id) {
    if (vis[nd ^ 1][id]) return;
    vis[nd ^ 1][id] = tm;
    sta[nwt ^ 1][++top[nwt ^ 1]] = id;
  }
  inline void Erase(int rt, int l, int r, int L, int R, int pl, int pr) {
    if (mx[rt] < pr && mn[rt] > pl) return;
    if (l == r) {
      while (head[l] <= tail[l] && vec[l][head[l]].first <= pl)
        Del(vec[l][head[l]].second), ++head[l];
      while (head[l] <= tail[l] && vec[l][tail[l]].first >= pr)
        Del(vec[l][tail[l]].second), --tail[l];
      Calc(rt, l);
      return;
    }
    int mid = (l + r) >> 1;
    if (L <= mid) Erase(rt << 1, l, mid, L, R, pl, pr);
    if (R > mid) Erase(rt << 1 | 1, mid + 1, r, L, R, pl, pr);
    update(rt);
  }
  inline void build(int n) {
    nd = n ^ 1;
    for (int i = 2; i <= N; i++) insert(fa[i], i);
    dfs(1, 0);
    for (int i = 2; i <= N; i++) {
      int u = i, v = tfa[n][i];
      vec[dfn[v]].push_back(make_pair(dfn[u], i - 1));
      vec[dfn[u]].push_back(make_pair(dfn[v], i - 1));
    }
    for (int i = 1; i <= N; i++) sort(vec[i].begin(), vec[i].end());
    buildT(1, 1, N);
  }
} T[2];
int main() {
  N = read();
  for (int i = 2; i <= N; i++) T[0].fa[i] = read(), tfa[0][i] = T[0].fa[i];
  for (int i = 2; i <= N; i++) T[1].fa[i] = read(), tfa[1][i] = T[1].fa[i];
  T[0].build(1);
  T[1].build(0);
  tm = 1;
  nwt = 1;
  int id = read();
  sta[nwt][++top[nwt]] = id;
  vis[0][id] = 1;
  while (top[nwt]) {
    top[nwt ^ 1] = 0;
    if (nwt)
      puts("Blue");
    else
      puts("Red");
    sort(sta[nwt] + 1, sta[nwt] + top[nwt] + 1);
    for (int i = 1; i <= top[nwt]; i++) printf("%d ", sta[nwt][i]);
    printf("\n");
    for (int i = 1; i <= top[nwt]; i++) {
      int k = sta[nwt][i];
      T[nwt ^ 1].Erase(1, 1, N, T[nwt ^ 1].L[k + 1], T[nwt ^ 1].R[k + 1],
                       T[nwt ^ 1].L[k + 1] - 1, T[nwt ^ 1].R[k + 1] + 1);
    }
    nwt ^= 1;
  }
  return 0;
}