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 N = 200005;
int n;
int len;
pair<int, int> seq[N], tmp[N];
vector<int> memson[2][N];
vector<pair<int, bool> > memson2[2][N];
struct tree {
  int L, R;
  int fa[N];
  vector<int> *son;
  vector<pair<int, bool> > *son2;
  vector<pair<int, bool> >::iterator head[N], tail[N];
  int ind, st[N], en[N], dfq[N];
  int mi[N * 4], ma[N * 4], vi[N * 4], va[N * 4];
  void add1(int x, int y) {
    fa[y] = x;
    son[x].push_back(y);
  }
  void add2(int x, int y) { son2[x].push_back(pair<int, bool>(y, false)); }
  void dfs(int u) {
    st[u] = ind;
    for (vector<int>::iterator e = son[u].begin(); e != son[u].end(); e++) {
      int v = *e;
      dfs(v);
    }
    en[u] = ++ind;
    dfq[ind] = u;
  }
  void update(int cur) {
    if (vi[cur << 1] < vi[cur << 1 | 1])
      mi[cur] = mi[cur << 1], vi[cur] = vi[cur << 1];
    else
      mi[cur] = mi[cur << 1 | 1], vi[cur] = vi[cur << 1 | 1];
    if (va[cur << 1] > va[cur << 1 | 1])
      ma[cur] = ma[cur << 1], va[cur] = va[cur << 1];
    else
      ma[cur] = ma[cur << 1 | 1], va[cur] = va[cur << 1 | 1];
  }
  void build(int cur, int beg, int end) {
    if (end - beg == 1) {
      mi[cur] = ma[cur] = dfq[end];
      vi[cur] = (head[dfq[end]] < tail[dfq[end]] ? head[dfq[end]]->first : N);
      va[cur] =
          (head[dfq[end]] < tail[dfq[end]] ? (tail[dfq[end]] - 1)->first : -N);
      return;
    }
    int mid = beg + end >> 1;
    build(cur << 1, beg, mid);
    build(cur << 1 | 1, mid, end);
    update(cur);
  }
  pair<int, int> querymi(int cur, int beg, int end) {
    if (end <= L || beg >= R) return pair<int, int>(0, N);
    if (L <= beg && R >= end) return pair<int, int>(mi[cur], vi[cur]);
    int mid = beg + end >> 1;
    pair<int, int> x = querymi(cur << 1, beg, mid),
                   y = querymi(cur << 1 | 1, mid, end);
    if (x.second < y.second)
      return x;
    else
      return y;
  }
  pair<int, int> queryma(int cur, int beg, int end) {
    if (end <= L || beg >= R) return pair<int, int>(0, -N);
    if (L <= beg && R >= end) return pair<int, int>(ma[cur], va[cur]);
    int mid = beg + end >> 1;
    pair<int, int> x = queryma(cur << 1, beg, mid),
                   y = queryma(cur << 1 | 1, mid, end);
    if (x.second > y.second)
      return x;
    else
      return y;
  }
  void renew(int cur, int beg, int end) {
    if (end - beg == 1) {
      vi[cur] = (head[mi[cur]] < tail[mi[cur]] ? head[mi[cur]]->first : N);
      va[cur] =
          (head[ma[cur]] < tail[ma[cur]] ? (tail[ma[cur]] - 1)->first : -N);
      return;
    }
    int mid = beg + end >> 1;
    if (R <= mid)
      renew(cur << 1, beg, mid);
    else
      renew(cur << 1 | 1, mid, end);
    update(cur);
  }
  void del(int x, int y) {
    vector<pair<int, bool> >::iterator it =
        lower_bound(head[x], tail[x], pair<int, bool>(en[y], false));
    it->second = true;
    while (head[x] < tail[x] && head[x]->second) head[x]++;
    while (head[x] < tail[x] && (tail[x] - 1)->second) tail[x]--;
    R = en[x];
    renew(1, 0, n);
  }
  void init() {
    dfs(1);
    for (int i = 0; i <= n; i++) {
      for (vector<pair<int, bool> >::iterator it = son2[i].begin();
           it != son2[i].end(); it++)
        it->first = en[it->first];
      sort(son2[i].begin(), son2[i].end());
      head[i] = son2[i].begin();
      tail[i] = son2[i].end();
    }
    build(1, 0, n);
  }
  void work(int x, int y) {
    if (fa[y] == x) swap(x, y);
    while (true) {
      L = st[x], R = en[x];
      int u = querymi(1, 0, n).first,
          v = (head[u] < tail[u] ? head[u]->first : N);
      if (v > st[x]) break;
      v = dfq[v];
      seq[len++] = pair<int, int>(u, v);
      del(u, v);
      del(v, u);
    }
    while (true) {
      L = st[x], R = en[x];
      int u = queryma(1, 0, n).first,
          v = (head[u] < tail[u] ? (tail[u] - 1)->first : -N);
      if (v <= en[x]) break;
      v = dfq[v];
      seq[len++] = pair<int, int>(u, v);
      del(u, v);
      del(v, u);
    }
  }
} a[2];
int main() {
  a[0].son = memson[0];
  a[0].son2 = memson2[0];
  a[1].son = memson[1];
  a[1].son2 = memson2[1];
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    int x;
    scanf("%d", &x);
    a[0].add1(x, i);
    a[1].add2(x, i);
    a[1].add2(i, x);
  }
  for (int i = 2; i <= n; i++) {
    int x;
    scanf("%d", &x);
    a[1].add1(x, i);
    a[0].add2(x, i);
    a[0].add2(i, x);
  }
  a[0].init();
  a[1].init();
  int id;
  scanf("%d", &id);
  id++;
  seq[len++] = pair<int, int>(id, a[0].fa[id]);
  a[1].del(seq[0].first, seq[0].second);
  a[1].del(seq[0].second, seq[0].first);
  int flag = 0;
  while (len) {
    int tmplen = len;
    memcpy(tmp, seq, sizeof(pair<int, int>) * tmplen);
    len = 0;
    for (int i = 0; i < tmplen; i++)
      if (a[flag].fa[tmp[i].second] == tmp[i].first)
        swap(tmp[i].first, tmp[i].second);
    sort(tmp, tmp + tmplen);
    if (flag == 0)
      puts("Blue");
    else
      puts("Red");
    for (int i = 0; i < tmplen; i++)
      printf("%d%c", tmp[i].first - 1, " \n"[i == tmplen - 1]);
    for (int i = 0; i < tmplen; i++) a[flag].work(tmp[i].first, tmp[i].second);
    flag ^= 1;
  }
}