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 = 0x3fffffff;
const int SINF = 0x7fffffff;
const long long LINF = 0x3fffffffffffffff;
const long long SLINF = 0x7fffffffffffffff;
const int MINF = 0x3f3f3f3f;
const int MAXN = 200007;
const int MAX = 262144;
const int MAXS = MAXN * 4;
class stT {
 public:
  stT() {
    memset(maxi, -MINF, sizeof(maxi));
    memset(mini, MINF, sizeof(mini));
  }
  void ins(int p, int x) {
    p += MAX - 1;
    data[p].insert(x);
    maxi[p] = *data[p].rbegin(), mini[p] = *data[p].begin();
    for (p >>= 1; p; p >>= 1)
      maxi[p] = (((maxi[p << 1]) > (maxi[p << 1 | 1])) ? (maxi[p << 1])
                                                       : (maxi[p << 1 | 1])),
      mini[p] = (((mini[p << 1]) < (mini[p << 1 | 1])) ? (mini[p << 1])
                                                       : (mini[p << 1 | 1]));
  }
  void del(int p, int x) {
    p += MAX - 1;
    data[p].erase(x);
    if (data[p].empty()) maxi[p] = -INF, mini[p] = INF;
    for (p >>= 1; p; p >>= 1)
      maxi[p] = (((maxi[p << 1]) > (maxi[p << 1 | 1])) ? (maxi[p << 1])
                                                       : (maxi[p << 1 | 1])),
      mini[p] = (((mini[p << 1]) < (mini[p << 1 | 1])) ? (mini[p << 1])
                                                       : (mini[p << 1 | 1]));
  }
  void querylt(int l, int r, int c, pair<int, int> del[], int &kd, int now = 1,
               int ll = 1, int rr = MAX) {
    if (l > r) return;
    if (mini[now] > c) return;
    if (ll >= l && rr <= r) {
      if (ll == rr) {
        set<int>::iterator it = data[now].begin();
        for (; it != data[now].end() && *it <= c; ++it)
          del[++kd] = make_pair(ll, *it);
      } else {
        int mid = (ll + rr) >> 1;
        querylt(l, r, c, del, kd, now << 1, ll, mid);
        querylt(l, r, c, del, kd, now << 1 | 1, mid + 1, rr);
      }
    } else if (rr < l || ll > r)
      return;
    else {
      int mid = (ll + rr) >> 1;
      querylt(l, r, c, del, kd, now << 1, ll, mid);
      querylt(l, r, c, del, kd, now << 1 | 1, mid + 1, rr);
    }
  }
  void querygt(int l, int r, int c, pair<int, int> del[], int &kd, int now = 1,
               int ll = 1, int rr = MAX) {
    if (l > r) return;
    if (maxi[now] < c) return;
    if (ll >= l && rr <= r) {
      if (ll == rr) {
        set<int>::reverse_iterator it = data[now].rbegin();
        for (; it != data[now].rend() && *it >= c; ++it)
          del[++kd] = make_pair(ll, *it);
      } else {
        int mid = (ll + rr) >> 1;
        querygt(l, r, c, del, kd, now << 1, ll, mid);
        querygt(l, r, c, del, kd, now << 1 | 1, mid + 1, rr);
      }
    } else if (rr < l || ll > r)
      return;
    else {
      int mid = (ll + rr) >> 1;
      querygt(l, r, c, del, kd, now << 1, ll, mid);
      querygt(l, r, c, del, kd, now << 1 | 1, mid + 1, rr);
    }
  }

 private:
  set<int> data[MAXS];
  int maxi[MAXS], mini[MAXS];
} sta, stb;
struct eT {
  void setd(int _u, int _v, int _l) { u = _u, v = _v, last = _l; }
  int u, v, last;
} ea[MAXN], eb[MAXN];
int n;
int ka, kb, la[MAXN], lb[MAXN];
int fa[MAXN], fb[MAXN];
pair<int, int> da[MAXN], db[MAXN];
int kda, kdb;
int kp;
int ila[MAXN], ira[MAXN], ida[MAXN], ilb[MAXN], irb[MAXN], idb[MAXN];
void init();
void input();
void work();
void dfs(int now, eT e[], int la[], int il[], int ir[], int id[]);
void simulate(int fa[], int fb[], stT &sta, stT &stb, int il[], int ir[],
              int id[], int oil[], int oir[], int oid[], pair<int, int> del[],
              int &kd, pair<int, int> nd[], int &kn, int f);
int main() {
  init();
  input();
  work();
}
void init() { ios::sync_with_stdio(false); }
void input() {
  scanf("%d", &n);
  for (int i = 2; i <= n; ++i) scanf("%d", &fa[i]);
  for (int i = 2; i <= n; ++i) scanf("%d", &fb[i]);
  kda = 1;
  scanf("%d", &da[1].first);
  ++da[1].first, da[1].second = fa[da[1].first];
}
void work() {
  memset(la, -1, sizeof(la));
  memset(lb, -1, sizeof(lb));
  for (int i = 2; i <= n; ++i) {
    ea[ka].setd(fa[i], i, la[fa[i]]);
    la[fa[i]] = ka++;
    eb[kb].setd(fb[i], i, lb[fb[i]]);
    lb[fb[i]] = kb++;
  }
  kp = 0;
  dfs(1, ea, la, ila, ira, ida);
  kp = 0;
  dfs(1, eb, lb, ilb, irb, idb);
  for (int i = 2; i <= n; ++i) {
    sta.ins(ila[i], ila[fb[i]]), sta.ins(ila[fb[i]], ila[i]);
    if (i ^ da[1].first)
      stb.ins(ilb[i], ilb[fa[i]]), stb.ins(ilb[fa[i]], ilb[i]);
  }
  simulate(fa, fb, sta, stb, ila, ira, ida, ilb, irb, idb, da, kda, db, kdb, 0);
}
void dfs(int now, eT e[], int la[], int il[], int ir[], int id[]) {
  il[now] = ir[now] = ++kp;
  id[kp] = now;
  int v;
  for (int i = la[now]; ~i; i = e[i].last) {
    v = e[i].v;
    dfs(v, e, la, il, ir, id);
    ir[now] = ir[v];
  }
}
void simulate(int fa[], int fb[], stT &sta, stT &stb, int il[], int ir[],
              int id[], int oil[], int oir[], int oid[], pair<int, int> del[],
              int &kd, pair<int, int> nd[], int &kn, int f) {
  if (!kd) return;
  sort(del + 1, del + 1 + kd);
  printf(f ? "Red\n" : "Blue\n");
  for (int i = 1; i <= kd; ++i) printf("%d ", del[i].first - 1);
  putchar('\n');
  kn = 0;
  int pn;
  for (int i = 1; i <= kd; ++i) {
    int u = del[i].first;
    int nl = il[u], nr = ir[u];
    pn = kn;
    sta.querylt(nl, nr, nl - 1, nd, kn);
    sta.querygt(nl, nr, nr + 1, nd, kn);
    for (int j = pn + 1; j <= kn; ++j) {
      sta.del(nd[j].first, nd[j].second);
      sta.del(nd[j].second, nd[j].first);
    }
  }
  for (int i = 1; i <= kn; ++i) {
    nd[i].first = id[nd[i].first], nd[i].second = id[nd[i].second];
    if (fb[nd[i].second] == nd[i].first) swap(nd[i].first, nd[i].second);
  }
  simulate(fb, fa, stb, sta, oil, oir, oid, il, ir, id, nd, kn, del, kd, f ^ 1);
}