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 MAXN = 2e5 + 5;
int N;
int mx(int x, int y) {
  if (x == y && x == MAXN) return MAXN;
  if (x == MAXN) return y;
  if (y == MAXN) return x;
  return max(x, y);
}
int mn(int x, int y) {
  if (x == y && x == MAXN) return MAXN;
  if (x == MAXN) return y;
  if (y == MAXN) return x;
  return min(x, y);
}
struct Tree {
  int par[MAXN], childMx[MAXN], childMn[MAXN];
  int Eu[MAXN], st[MAXN], ed[MAXN];
  int parId[MAXN];
  int at(int x) { return x; }
  set<int> dx[MAXN];
  struct OpposeIT {
    struct node {
      int mxPar, mnPar, mnChild, mxChild;
      void merge(node a, node b, Tree &tr) {
        if (b.mxPar == 0) return *this = a, void();
        if (a.mxPar == 0) return *this = b, void();
        mxPar =
            (mx(tr.par[a.mxPar], tr.par[b.mxPar]) == tr.par[a.mxPar] ? a.mxPar
                                                                     : b.mxPar);
        mnPar =
            (mn(tr.par[a.mnPar], tr.par[b.mnPar]) == tr.par[a.mnPar] ? a.mnPar
                                                                     : b.mnPar);
        mxChild =
            (mx(tr.childMx[tr.at(a.mxChild)], tr.childMx[tr.at(b.mxChild)]) ==
                     tr.childMx[tr.at(a.mxChild)]
                 ? a.mxChild
                 : b.mxChild);
        mnChild =
            (mn(tr.childMn[tr.at(a.mnChild)], tr.childMn[tr.at(b.mnChild)]) ==
                     tr.childMn[tr.at(a.mnChild)]
                 ? a.mnChild
                 : b.mnChild);
      }
    } T[4 * MAXN];
    void init(int v, int l, int r, Tree &tr, Tree &th) {
      if (l == r) {
        T[v].mxPar = T[v].mnPar = T[v].mxChild = T[v].mnChild = th.Eu[l];
        return;
      }
      init(2 * v, l, ((l + r) >> 1), tr, th);
      init(2 * v + 1, ((l + r) >> 1) + 1, r, tr, th);
      T[v].merge(T[2 * v], T[2 * v + 1], tr);
    }
    void update(int v, int l, int r, int pos, Tree &tr) {
      if (l > pos || r < pos) return;
      if (l == r) return;
      update(2 * v, l, ((l + r) >> 1), pos, tr);
      update(2 * v + 1, ((l + r) >> 1) + 1, r, pos, tr);
      T[v].merge(T[2 * v], T[2 * v + 1], tr);
    }
    node get(int v, int l, int r, int i, int j, Tree &tr) {
      if (l > j || r < i) return node();
      if (i <= l && r <= j) return T[v];
      node ans;
      ans.merge(get(2 * v, l, ((l + r) >> 1), i, j, tr),
                get(2 * v + 1, ((l + r) >> 1) + 1, r, i, j, tr), tr);
      return ans;
    }
  } Op;
  vector<int> G[MAXN];
  int dfs(int v, int Time = 0) {
    Eu[++Time] = v;
    st[v] = Time;
    for (auto u : G[v]) {
      if (st[u]) continue;
      parId[u] = v;
      Time = dfs(u, Time);
    }
    ed[v] = Time;
    return Time;
  }
  void prep() {
    par[1] = MAXN, parId[1] = MAXN;
    dfs(1);
  }
  void rem(int u, int v, int eupos) {
    if (st[u] > st[v]) swap(u, v);
    par[v] = MAXN;
    dx[u].erase(eupos);
    childMx[u] = (dx[u].size() ? *(--dx[u].end()) : MAXN);
    childMn[u] = (dx[u].size() ? *(dx[u].begin()) : MAXN);
  }
} Tr[2];
void prep() {
  Tr[0].prep();
  Tr[1].prep();
  for (int i = 0; i < 2; ++i) {
    for (int j = 2; j <= N; ++j) {
      Tr[i].par[j] = Tr[!i].st[Tr[i].parId[j]];
      Tr[i].dx[Tr[i].parId[j]].insert(Tr[!i].st[j]);
    }
    for (int u = 1; u <= N; ++u) {
      Tr[i].childMx[u] = (Tr[i].dx[u].size() ? *(--Tr[i].dx[u].end()) : MAXN);
      Tr[i].childMn[u] = (Tr[i].dx[u].size() ? *(Tr[i].dx[u].begin()) : MAXN);
    }
  }
  Tr[0].Op.init(1, 1, N, Tr[1], Tr[0]);
  Tr[1].Op.init(1, 1, N, Tr[0], Tr[1]);
}
vector<int> toRemove;
vector<int> toScan;
int input[2][MAXN];
void rem(int id, int u, int v) {
  if (Tr[id].st[u] > Tr[id].st[v]) swap(u, v);
  if (input[id][v] == u)
    toRemove.push_back(v - 1);
  else
    toRemove.push_back(u - 1);
  Tr[id].rem(u, v, Tr[!id].st[v]);
  Tr[!id].Op.update(1, 1, N, Tr[!id].st[v], Tr[id]);
  Tr[!id].Op.update(1, 1, N, Tr[!id].st[u], Tr[id]);
}
void scan(int id, int v) {
  do {
    auto X = Tr[id].Op.get(1, 1, N, Tr[id].st[v], Tr[id].ed[v], Tr[!id]);
    if (Tr[!id].par[X.mxPar] != MAXN && Tr[!id].par[X.mxPar] > Tr[id].ed[v]) {
      rem(!id, Tr[!id].parId[X.mxPar], X.mxPar);
      continue;
    }
    if (Tr[!id].par[X.mnPar] != MAXN && Tr[!id].par[X.mnPar] < Tr[id].st[v]) {
      rem(!id, Tr[!id].parId[X.mnPar], X.mnPar);
      continue;
    }
    if (Tr[!id].childMn[X.mnChild] != MAXN &&
        Tr[!id].childMn[X.mnChild] < Tr[id].st[v]) {
      rem(!id, Tr[id].Eu[Tr[!id].childMn[X.mnChild]], X.mnChild);
      continue;
    }
    if (Tr[!id].childMx[X.mxChild] != MAXN &&
        Tr[!id].childMx[X.mxChild] > Tr[id].ed[v]) {
      rem(!id, Tr[id].Eu[Tr[!id].childMx[X.mxChild]], X.mxChild);
      continue;
    }
    break;
  } while (true);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> N;
  for (int i = 0; i < 2; ++i) {
    for (int j = 2; j <= N; ++j) {
      int x;
      cin >> x;
      input[i][j] = x;
      Tr[i].G[x].push_back(j);
      Tr[i].G[j].push_back(x);
    }
  }
  prep();
  int K;
  cin >> K;
  rem(0, Tr[0].parId[K + 1], K + 1);
  printf("Blue\n%d\n", K);
  for (int s = 0;; ++s) {
    toScan = toRemove;
    toRemove.clear();
    for (auto u : toScan) scan((s & 1), u + 1);
    if (toRemove.empty()) break;
    printf("%s\n", ((s & 1) ? "Blue" : "Red"));
    sort(toRemove.begin(), toRemove.end());
    for (auto u : toRemove) printf("%d ", u);
    printf("\n");
  }
}