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;
vector<pair<int, int> > init[2][200100];
struct node {
  int deep, eno, no;
  node(int a = 0, int b = 0, int c = 0) : deep(a), eno(b), no(c) {}
  bool operator<(const node &a) const { return deep < a.deep; }
};
template <class t>
struct segment_node {
  int be, en;
  t minv;
};
struct segment_tree {
  int l;
  segment_node<node> tree[200100 * 4];
  inline int gleft(int no) { return no << 1; }
  inline int gright(int no) { return (no << 1) + 1; }
  inline int gfa(int no) { return no >> 1; }
  inline segment_tree() { l = 0; }
  void build(int no, int l, int r, vector<pair<int, int> > *a) {
    if (l > r) r = l;
    if (l == r) {
      tree[no].be = tree[no].en = l;
      tree[no].minv = node(10000000, 0, l);
      if (a[l].size())
        tree[no].minv =
            node(a[l][a[l].size() - 1].first, a[l][a[l].size() - 1].second, l);
      return;
    }
    tree[no].be = l;
    tree[no].en = r;
    int mid = (l + r) / 2;
    build(gleft(no), l, mid, a);
    build(gright(no), mid + 1, r, a);
    tree[no].minv = min(tree[gleft(no)].minv, tree[gright(no)].minv);
  }
  void down(int loc, int no, vector<pair<int, int> > *a) {
    if (loc <= tree[no].be && loc >= tree[no].en) {
      tree[no].minv = node(100000000, 0, tree[no].be);
      a[loc].erase(a[loc].end() - 1);
      if (a[loc].size())
        tree[no].minv = node(a[loc][a[loc].size() - 1].first,
                             a[loc][a[loc].size() - 1].second, tree[no].be);
      return;
    }
    int mid = (tree[no].be + tree[no].en) / 2;
    if (loc <= mid)
      down(loc, gleft(no), a);
    else
      down(loc, gright(no), a);
    tree[no].minv = min(tree[gleft(no)].minv, tree[gright(no)].minv);
  }
  node getmin(int l, int r, int no) {
    if (l > r) return 0;
    if (l <= tree[no].be && r >= tree[no].en) return tree[no].minv;
    node ans = node(100000000, 0, -1);
    int mid = (tree[no].be + tree[no].en) / 2;
    if (r >= tree[no].be && l <= mid)
      ans = min(getmin(max(l, tree[no].be), min(r, mid), gleft(no)), ans);
    if (r >= mid + 1 && l <= tree[no].en)
      ans = min(getmin(max(l, mid + 1), min(r, tree[no].en), gright(no)), ans);
    return ans;
  }
} sgt[2];
const int maxn = 200100;
int fa[2][maxn][22], deep[2][maxn];
int n;
inline void initfa() {
  for (int t = 0; t < 2; t++)
    for (int i = 1; i <= 20; i++) {
      for (int j = 0; j < n; j++) {
        if (fa[t][j][i - 1] == -1)
          fa[t][j][i] = -1;
        else
          fa[t][j][i] = fa[t][fa[t][j][i - 1]][i - 1];
      }
    }
}
inline int getfa(int cate, int no, int l) {
  for (int i = 0; l; l >>= 1, i++)
    if (l & 1) no = fa[cate][no][i];
  return no;
}
inline int getlca(int cate, int a, int b) {
  if (deep[cate][a] > deep[cate][b]) swap(a, b);
  b = getfa(cate, b, deep[cate][b] - deep[cate][a]);
  if (b == a) return a;
  for (int i = 20; i >= 0; i--)
    if (fa[cate][a][i] != fa[cate][b][i]) {
      a = fa[cate][a][i];
      b = fa[cate][b][i];
    }
  return fa[cate][a][0];
}
int range[2][maxn][2];
struct edge {
  int to, nxt;
} e[2][maxn * 2];
int le[2], head[2][maxn];
int arr[2][maxn], larr[2], loc[2][maxn];
int q[2][maxn], lq[2];
bool flag[2][maxn];
inline void addedge(int cate, int a, int b) {
  e[cate][le[cate]].to = b;
  e[cate][le[cate]].nxt = head[cate][a];
  head[cate][a] = le[cate]++;
}
void dfs(int cate, int no) {
  range[cate][no][0] = larr[cate];
  loc[cate][no] = larr[cate];
  arr[cate][larr[cate]++] = no;
  for (int i = head[cate][no]; i != -1; i = e[cate][i].nxt)
    if (e[cate][i].to != fa[cate][no][0]) {
      fa[cate][e[cate][i].to][0] = no;
      deep[cate][e[cate][i].to] = deep[cate][no] + 1;
      dfs(cate, e[cate][i].to);
    }
  range[cate][no][1] = larr[cate] - 1;
}
inline int getpoint(int cate, int edgeno) {
  int a = e[cate][edgeno].to, b = e[cate][edgeno + 1].to;
  if (fa[cate][a][0] != b) a = b;
  return a;
}
inline void add(int cate, int no, int deep, int eno) {
  init[cate][loc[cate][no]].push_back(make_pair(deep, eno));
}
int main() {
  ios_base::sync_with_stdio(0);
  memset(head, -1, sizeof(head));
  le[0] = le[1] = 0;
  scanf("%d", &n);
  for (int t = 0; t < 2; t++) {
    for (int i = 1; i < n; i++) {
      int no;
      scanf("%d", &no);
      no--;
      addedge(t, i, no);
      addedge(t, no, i);
    }
  }
  larr[0] = larr[1] = 0;
  fa[0][0][0] = fa[1][0][0] = -1;
  dfs(0, 0);
  dfs(1, 0);
  initfa();
  for (int now = 0; now < 2; now++) {
    int nxt = 1 - now;
    for (int i = 0; i < le[now]; i += 2) {
      int a = e[now][i].to, b = e[now][i + 1].to;
      int rfa = getlca(nxt, a, b);
      add(nxt, a, deep[nxt][rfa], i / 2 + 1);
      add(nxt, b, deep[nxt][rfa], i / 2 + 1);
    }
    for (int i = 0; i < n; i++) {
      sort(init[nxt][i].begin(), init[nxt][i].end());
      reverse(init[nxt][i].begin(), init[nxt][i].end());
    }
    sgt[nxt].build(1, 0, n - 1, init[nxt]);
  }
  int edgeno;
  scanf("%d", &edgeno);
  flag[0][edgeno] = 1;
  q[0][lq[0]++] = edgeno;
  for (int now = 0, nxt = 1; lq[now]; swap(now, nxt)) {
    if (now & 1)
      puts("Red");
    else
      puts("Blue");
    for (int i = 0; i < lq[now]; i++) printf("%d ", q[now][i]);
    printf("\n");
    vector<pair<int, int> > arr1;
    for (int i = 0; i < lq[now]; i++) {
      int k = getpoint(now, (q[now][i] - 1) * 2);
      node a;
      while (
          (a = sgt[now].getmin(range[now][k][0], range[now][k][1], 1)).deep <=
          deep[now][k] - 1) {
        sgt[now].down(a.no, 1, init[now]);
        if (flag[nxt][a.eno] == 0) {
          flag[nxt][a.eno] = 1;
          arr1.push_back(make_pair(a.deep, a.eno));
        }
      }
    }
    lq[nxt] = 0;
    for (int i = 0; i < (int)arr1.size(); i++)
      q[nxt][lq[nxt]++] = arr1[i].second;
    sort(q[nxt], q[nxt] + lq[nxt]);
    lq[nxt] = unique(q[nxt], q[nxt] + lq[nxt]) - q[nxt];
  }
  return 0;
}