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 a, b, c, d, e, f, g, h, i, j, k;
vector<int> Del, tmp;
bool v[2][N];
struct Segment_Tree {
  struct node {
    int left, right;
    priority_queue<pair<int, int> > E;
  };
  node tree[N << 2];
  void Build(int root, int left, int right) {
    tree[root].left = left, tree[root].right = right;
    if (left == right) return;
    int mid = (left + right) >> 1;
    Build(root << 1, left, mid);
    Build(root << 1 | 1, mid + 1, right);
  }
  void Add(int root, int pos, pair<int, int> ee) {
    tree[root].E.push(ee);
    if (tree[root].left == pos && tree[root].right == pos) return;
    int mid = (tree[root].left + tree[root].right) >> 1;
    if (pos <= mid)
      Add(root << 1, pos, ee);
    else
      Add(root << 1 | 1, pos, ee);
  }
  void Find(int root, int ll, int rr, int L, int R, int type, int now) {
    if (tree[root].left == ll && tree[root].right == rr) {
      if (type == 0) {
        while (!tree[root].E.empty()) {
          pair<int, int> it = tree[root].E.top();
          it.first *= -1;
          if (it.first >= L) break;
          if (v[now][it.second] == false)
            v[now][it.second] = true, Del.push_back(it.second);
          tree[root].E.pop();
        }
      } else {
        while (!tree[root].E.empty()) {
          pair<int, int> it = tree[root].E.top();
          if (it.first <= R) break;
          if (v[now][it.second] == false)
            v[now][it.second] = true, Del.push_back(it.second);
          tree[root].E.pop();
        }
      }
      return;
    }
    int mid = (tree[root].left + tree[root].right) >> 1;
    if (rr <= mid)
      Find(root << 1, ll, rr, L, R, type, now);
    else if (ll > mid)
      Find(root << 1 | 1, ll, rr, L, R, type, now);
    else {
      Find(root << 1, ll, mid, L, R, type, now);
      Find(root << 1 | 1, mid + 1, rr, L, R, type, now);
    }
  }
};
struct Tree {
  vector<int> tree[N];
  int father[N], deep[N];
  pair<int, int> site[N];
  int tot;
  Segment_Tree Seg[2];
  void Add_Edge(int x, int y) { tree[y].push_back(x); }
  void Build() {
    for (int ii = 2; ii <= a; ii++) Add_Edge(ii, father[ii]);
    Seg[0].Build(1, 1, a), Seg[1].Build(1, 1, a);
  }
  void soso(int x) {
    site[x].first = ++tot;
    deep[x] = deep[father[x]] + 1;
    for (int ii = 0; ii < tree[x].size(); ii++) soso(tree[x][ii]);
    site[x].second = tot;
  }
  void Work(int now, int x, int y, int L, int R) {
    if (deep[x] < deep[y]) swap(x, y);
    Seg[0].Find(1, L, R, L, R, 1, now);
    Seg[1].Find(1, L, R, L, R, 0, now);
  }
};
Tree T[2];
int main() {
  cin >> a;
  for (i = 2; i <= a; i++) scanf("%d", &T[0].father[i]);
  for (i = 2; i <= a; i++) scanf("%d", &T[1].father[i]);
  T[0].Build(), T[1].Build();
  T[0].soso(1), T[1].soso(1);
  for (i = 2; i <= a; i++) {
    int p = T[1].site[i].first, q = T[1].site[T[0].father[i]].first;
    if (p > q) swap(p, q);
    T[0].Seg[0].Add(1, p, make_pair(q, i - 1));
    T[0].Seg[1].Add(1, q, make_pair(-p, i - 1));
    p = T[0].site[i].first, q = T[0].site[T[1].father[i]].first;
    if (p > q) swap(p, q);
    T[1].Seg[0].Add(1, p, make_pair(q, i - 1));
    T[1].Seg[1].Add(1, q, make_pair(-p, i - 1));
  }
  cin >> c;
  Del.push_back(c), v[0][c] = true;
  int now = 0;
  while (true) {
    if (Del.size() == 0) break;
    if (now == 0)
      printf("Blue\n");
    else
      printf("Red\n");
    sort(Del.begin(), Del.end());
    for (i = 0; i < Del.size(); i++) printf("%d ", Del[i]);
    printf("\n");
    tmp = Del, Del.clear();
    for (i = 0; i < tmp.size(); i++)
      T[now ^ 1].Work(now ^ 1, tmp[i] + 1, T[now].father[tmp[i] + 1],
                      T[now].site[tmp[i] + 1].first,
                      T[now].site[tmp[i] + 1].second);
    now ^= 1;
  }
  return 0;
}