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 Read() {
  char c;
  while (c = getchar(), (c != '-') && (c < '0' || c > '9'))
    ;
  bool neg = (c == '-');
  int ret = (neg ? 0 : c - 48);
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + c - 48;
  return neg ? -ret : ret;
}
const int MAXN = 200005;
struct node {
  int mi, ma, fi, fa;
} ret, t1[1 << 19], t2[1 << 19];
vector<int> stage[MAXN << 1];
set<int> s1[MAXN], s2[MAXN];
int top, ti, stk[MAXN], cur[MAXN], bg1[MAXN], en1[MAXN], bg2[MAXN], en2[MAXN],
    seq1[MAXN], seq2[MAXN];
int N, cnt, st1[MAXN], st2[MAXN], nxt[MAXN * 4], lnk[MAXN * 4], a[MAXN],
    b[MAXN];
void init() {
  scanf("%d", &N);
  for (int i = 2; i <= N; i++) {
    int x = Read();
    a[i] = x;
    lnk[++cnt] = i, nxt[cnt] = st1[x], st1[x] = cnt;
    lnk[++cnt] = x, nxt[cnt] = st1[i], st1[i] = cnt;
  }
  for (int i = 2; i <= N; i++) {
    int x = Read();
    b[i] = x;
    lnk[++cnt] = i, nxt[cnt] = st2[x], st2[x] = cnt;
    lnk[++cnt] = x, nxt[cnt] = st2[i], st2[i] = cnt;
  }
}
void Traverse(int *bg, int *en, int *seq) {
  top = ti = stk[1] = bg[1] = seq[1] = 1;
  while (top) {
    int x = stk[top];
    bool find = 0;
    for (int i = cur[x], y = lnk[i]; i; i = nxt[i], y = lnk[i])
      if (!bg[y]) {
        bg[y] = ++ti, seq[ti] = stk[++top] = y;
        find = 1, cur[x] = nxt[i];
        break;
      }
    if (!find) en[x] = ti, --top;
  }
}
void Update(node &t, node tp) {
  if (tp.mi < t.mi) t.mi = tp.mi, t.fi = tp.fi;
  if (tp.ma > t.ma) t.ma = tp.ma, t.fa = tp.fa;
}
void iniTree(node *t, set<int> *s, int *seq, int id, int l, int r) {
  if (l == r) {
    int x = seq[l];
    t[id].fi = t[id].fa = x;
    if (s[x].size()) {
      t[id].mi = *s[x].begin();
      set<int>::iterator tmp = s[x].end();
      tmp--;
      t[id].ma = *tmp;
    } else
      t[id].mi = N + 1, t[id].ma = 0;
    return;
  }
  int mid = (l + r) >> 1;
  iniTree(t, s, seq, id + id, l, mid),
      iniTree(t, s, seq, id + id + 1, mid + 1, r);
  t[id] = t[id + id], Update(t[id], t[id + id + 1]);
}
void Remove(node *t, set<int> *s, int *seq, int id, int l, int r, int z,
            int v) {
  if (l == r) {
    int x = seq[l];
    s[x].erase(v);
    if (s[x].size()) {
      t[id].mi = *s[x].begin();
      set<int>::iterator tmp = s[x].end();
      tmp--;
      t[id].ma = *tmp;
    } else
      t[id].mi = N + 1, t[id].ma = 0;
    return;
  }
  int mid = (l + r) >> 1;
  if (z <= mid)
    Remove(t, s, seq, id + id, l, mid, z, v);
  else
    Remove(t, s, seq, id + id + 1, mid + 1, r, z, v);
  t[id] = t[id + id], Update(t[id], t[id + id + 1]);
}
void Query(node *t, int id, int l, int r, int gl, int gr) {
  if (gl <= l && r <= gr) {
    Update(ret, t[id]);
    return;
  }
  int mid = (l + r) >> 1;
  if (gl <= mid) Query(t, id + id, l, mid, gl, gr);
  if (gr > mid) Query(t, id + id + 1, mid + 1, r, gl, gr);
}
void Search(int cb, int *bg, int *en, int *bd, int *seq, node *t, set<int> *s,
            int x, int y) {
  if (bg[x] < bg[y]) swap(x, y);
  for (;;) {
    ret.mi = N + 1, ret.ma = 0;
    Query(t, 1, 1, N, bg[x], en[x]);
    bool cont = 0;
    if (ret.mi < bg[x]) {
      int dx = seq[ret.mi], dy = ret.fi;
      if (bd[dy] == dx) swap(dx, dy);
      stage[cb + 1].push_back(dx - 1), cont = 1;
      Remove(t, s, seq, 1, 1, N, bg[dx], bg[dy]);
      Remove(t, s, seq, 1, 1, N, bg[dy], bg[dx]);
    }
    if (ret.ma > en[x]) {
      int dx = seq[ret.ma], dy = ret.fa;
      if (bd[dy] == dx) swap(dx, dy);
      stage[cb + 1].push_back(dx - 1), cont = 1;
      Remove(t, s, seq, 1, 1, N, bg[dx], bg[dy]);
      Remove(t, s, seq, 1, 1, N, bg[dy], bg[dx]);
    }
    if (!cont) return;
  }
}
void work() {
  memcpy(cur, st1, sizeof(cur)), Traverse(bg1, en1, seq1);
  memcpy(cur, st2, sizeof(cur)), Traverse(bg2, en2, seq2);
  for (int i = 2; i <= N; i++) {
    int x = i, y = a[i];
    s2[x].insert(bg2[y]);
    s2[y].insert(bg2[x]);
  }
  for (int i = 2; i <= N; i++) {
    int x = i, y = b[i];
    s1[x].insert(bg1[y]);
    s1[y].insert(bg1[x]);
  }
  iniTree(t1, s1, seq1, 1, 1, N);
  iniTree(t2, s2, seq2, 1, 1, N);
  int fir = Read();
  stage[1].push_back(fir);
  int tx = fir + 1, ty = a[fir + 1];
  Remove(t2, s2, seq2, 1, 1, N, bg2[tx], bg2[ty]);
  Remove(t2, s2, seq2, 1, 1, N, bg2[ty], bg2[tx]);
  for (int cb = 1; cb <= N + N; cb++) {
    if (!stage[cb].size()) return;
    sort(stage[cb].begin(), stage[cb].end());
    puts(cb & 1 ? "Blue" : "Red");
    for (int i = 0; i <= stage[cb].size() - 1; i++) {
      printf("%d%c", stage[cb][i], i + 1 < stage[cb].size() ? ' ' : '\n');
      if (cb & 1)
        Search(cb, bg1, en1, b, seq1, t1, s1, stage[cb][i] + 1,
               a[stage[cb][i] + 1]);
      else
        Search(cb, bg2, en2, a, seq2, t2, s2, stage[cb][i] + 1,
               b[stage[cb][i] + 1]);
    }
  }
}
int main() {
  init();
  work();
  return 0;
}