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 = 1e9 + 333;
const long long linf = 1e18 + 333;
const int N = 1 << 18;
class edge {
 public:
  int x, y, id;
  edge() { x = y = id = 0; }
  edge(int _x, int _y, int _id) { x = _x, y = _y, id = _id; }
};
int n, sz;
bool h[2][N];
vector<int> del;
vector<int> v[2][N];
int vec[N], tm[2], st[2][N], nd[2][N], x[2][N], y[2][N], a[2][N];
edge e[N];
class node {
 public:
  int ptr;
  vector<int> v;
  node() {
    ptr = 0;
    v.clear();
  }
  void add(int i) { v.push_back(i); }
  void del(int w, int l, int r) {
    while (ptr < v.size()) {
      int i = v.back();
      if (h[!w][i]) {
        v.pop_back();
        continue;
      }
      int x1 = st[w][x[!w][i]];
      int x2 = st[w][y[!w][i]];
      if ((l <= x1 and x1 <= r) ^ (l <= x2 and x2 <= r)) {
        vec[sz++] = i;
        h[!w][i] = 1;
        v.pop_back();
      } else
        break;
    }
    while (ptr < v.size()) {
      int i = v[ptr];
      if (h[!w][i]) {
        ptr++;
        continue;
      }
      int x1 = st[w][x[!w][i]];
      int x2 = st[w][y[!w][i]];
      if ((l <= x1 and x1 <= r) ^ (l <= x2 and x2 <= r)) {
        vec[sz++] = i;
        h[!w][i] = 1;
        ptr++;
      } else
        break;
    }
  }
};
class tree {
 public:
  int id;
  node t[N << 1];
  void add(int x, int i) {
    x += N;
    while (x >= 1) {
      t[x].add(i);
      x >>= 1;
    }
  }
  void del(int l, int r, int x, int y) {
    l += N;
    r += N;
    for (; l <= r; l >>= 1, r >>= 1) {
      if (l & 1) t[l++].del(id, x, y);
      if (~r & 1) t[r--].del(id, x, y);
    }
  }
} t[2][2];
void dfs(int w, int p, int x) {
  st[w][x] = ++tm[w];
  for (__typeof((v[w][x]).begin()) it = (v[w][x]).begin();
       it != (v[w][x]).end(); it++) {
    int u = *it;
    if (u != p) dfs(w, x, u);
  }
  nd[w][x] = tm[w];
}
bool cmpX(edge x, edge y) { return x.x < y.x; }
bool cmpY(edge x, edge y) { return x.y < y.y; }
int main() {
  t[0][0].id = t[0][1].id = 0;
  t[1][0].id = t[1][1].id = 1;
  scanf("%d", &n);
  for (int w = 0; w < 2; w++) {
    for (int i = 2; i <= n; i++) {
      x[w][i] = i;
      scanf("%d", y[w] + i);
      v[w][x[w][i]].push_back(y[w][i]);
      v[w][y[w][i]].push_back(x[w][i]);
    }
    dfs(w, -1, 1);
  }
  for (int w = 0; w < 2; w++) {
    for (int i = 2; i <= n; i++) {
      if (st[!w][x[w][i]] > st[!w][y[w][i]]) swap(x[w][i], y[w][i]);
      e[i] = {st[!w][x[w][i]], st[!w][y[w][i]], i};
    }
    sort(e + 2, e + n + 1, cmpX);
    for (int i = 2; i <= n; i++) t[!w][1].add(e[i].y, e[i].id);
    sort(e + 2, e + n + 1, cmpY);
    for (int i = 2; i <= n; i++) t[!w][0].add(e[i].x, e[i].id);
  }
  int del_x = -1;
  bool col = 0;
  scanf("%d", &del_x);
  del_x++;
  del.push_back(del_x);
  while (del.size()) {
    puts(col ? "Red" : "Blue");
    sz = 0;
    for (__typeof((del).begin()) it = (del).begin(); it != (del).end(); it++) {
      del_x = *it;
      printf("%d ", del_x - 1);
      h[col][del_x] = 1;
      int l = st[col][x[col][del_x]];
      int r = nd[col][x[col][del_x]];
      int l1 = st[col][y[col][del_x]];
      int r1 = nd[col][y[col][del_x]];
      if (l1 > l) {
        swap(l, l1);
        swap(r, r1);
      }
      t[col][0].del(l, r, l, r);
      t[col][1].del(l, r, l, r);
    }
    puts("");
    col ^= 1;
    del.clear();
    sort(vec, vec + sz);
    for (int i = 0; i < sz; i++) del.push_back(vec[i]);
  }
  return 0;
}