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;
int n, pt, cnt, q[200005], h[200005], pos[200005];
int read() {
  int x = 0;
  char cr = getchar();
  while (cr < '0' || cr > '9') cr = getchar();
  while (cr >= '0' && cr <= '9') {
    x = x * 10 + cr - '0';
    cr = getchar();
  }
  return x;
}
bool cmp(int x, int y) { return h[x] < h[y]; }
struct tree {
  int tot, dfsclk, fst[200005], pnt[200005 << 1], nxt[200005 << 1], a[200005],
      na[200005], b[200005], c[200005];
  int lf[200005], rg[200005], id[200005], fa[200005], d[200005], sz[200005],
      son[200005], anc[200005], val[200005 << 2];
  bool dlt[200005];
  void add(int x, int y) {
    pnt[++tot] = y;
    nxt[tot] = fst[x];
    fst[x] = tot;
  }
  void dfs(int x) {
    int i, y;
    sz[x] = 1;
    for (i = fst[x]; i; i = nxt[i]) {
      y = pnt[i];
      if (y != fa[x]) {
        fa[y] = x;
        d[y] = d[x] + 1;
        dfs(y);
        sz[x] += sz[y];
        if (sz[y] > sz[son[x]]) son[x] = y;
      }
    }
  }
  void dvd(int x, int tp) {
    int i, y;
    id[lf[x] = ++dfsclk] = x;
    anc[x] = tp;
    if (son[x]) dvd(son[x], tp);
    for (i = fst[x]; i; i = nxt[i]) {
      y = pnt[i];
      if (y != fa[x] && y != son[x]) dvd(y, y);
    }
    rg[x] = dfsclk;
  }
  int lca(int x, int y) {
    for (; anc[x] != anc[y]; x = fa[anc[x]])
      if (d[anc[x]] < d[anc[y]]) swap(x, y);
    return (d[x] < d[y]) ? x : y;
  }
  void init() {
    int i;
    for (i = 2; i <= n; i++) {
      a[i] = read();
      add(a[i], i);
      add(i, a[i]);
    }
    d[1] = 1;
    dfs(1);
    dvd(1, 1);
  }
  int ls(int x, int y) { return (b[c[x]] < b[c[y]]) ? x : y; }
  void ins(int x, int y) {
    int i;
    x = lf[x];
    add(x, y);
    c[x] = y;
    for (i = pos[x] >> 1; i; i >>= 1) val[i] = ls(val[i << 1], val[i << 1 | 1]);
  }
  void mdy(int x) {
    int i;
    x = lf[x];
    bool flag = dlt[c[x]];
    for (; dlt[c[x]]; c[x] = pnt[fst[x] = nxt[fst[x]]])
      ;
    if (flag)
      for (i = pos[x] >> 1; i; i >>= 1)
        val[i] = ls(val[i << 1], val[i << 1 | 1]);
  }
  int qry(int k, int l, int r, int x, int y) {
    if (x <= l && r <= y) return val[k];
    int mid = l + r >> 1, z = 0;
    if (x <= mid) z = ls(z, qry(k << 1, l, mid, x, y));
    if (y > mid) z = ls(z, qry(k << 1 | 1, mid + 1, r, x, y));
    return z;
  }
  void pwk() {
    int i, x;
    memset(fst, 0, sizeof(fst));
    tot = 0;
    for (i = 2; i <= n; i++) b[i] = d[lca(na[i], i)];
    for (i = 2; i <= n; i++) {
      q[i] = i;
      h[i] = b[i];
    }
    sort(q + 2, q + n + 1, cmp);
    b[0] = 1000000000;
    for (i = 1; i <= n; i++) ins(i, 0);
    for (i = n; i > 1; i--) {
      x = q[i];
      ins(x, x);
      ins(na[x], x);
    }
  }
  void solve() {
    int i, x, y, u;
    for (i = 1; i <= pt; i++) {
      x = q[i];
      y = a[x];
      if (x == fa[y]) swap(x, y);
      for (; b[u = c[qry(1, 1, n, lf[x], rg[x])]] < d[x]; mdy(u), mdy(na[u]))
        dlt[h[++cnt] = u] = 1;
    }
  }
} B, R;
void build(int k, int l, int r) {
  B.val[k] = R.val[k] = l;
  if (l == r) {
    pos[l] = k;
    return;
  }
  int mid = l + r >> 1;
  build(k << 1, l, mid);
  build(k << 1 | 1, mid + 1, r);
}
int main() {
  n = read();
  build(1, 1, n);
  B.init();
  R.init();
  int i;
  for (i = 1; i <= n; i++) {
    B.na[i] = R.a[i];
    R.na[i] = B.a[i];
  }
  B.pwk();
  R.pwk();
  q[pt = 1] = read() + 1;
  printf("Blue\n%d\n", q[1] - 1);
  R.dlt[q[1]] = 1;
  R.mdy(q[1]);
  R.mdy(B.a[q[1]]);
  bool now = 0;
  for (; pt; now ^= 1) {
    cnt = 0;
    if (now)
      R.solve();
    else
      B.solve();
    pt = cnt;
    for (i = 1; i <= pt; i++) q[i] = h[i];
    if (pt) {
      puts((now) ? "Blue" : "Red");
      sort(q + 1, q + pt + 1);
      for (i = 1; i <= pt; i++) printf("%d%c", q[i] - 1, (i < pt) ? ' ' : '\n');
    }
  }
  return 0;
}