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 maxn = 2e5 + 10;
int n;
vector<pair<int, int> > adj[2][maxn];
pair<int, int> e[2 * maxn];
bool mrk[2 * maxn];
int IDX;
int st[2][maxn], ed[2][maxn], cur[2];
vector<pair<int, int> > E[2][maxn];
struct point {
  int x, y, id;
  point() { x = y = id = 0; }
  point(int x, int y, int id) : x(x), y(y), id(id) {}
};
inline bool operator<(point a, point b) { return a.x < b.x; };
inline point min(point a, point b) { return a < b ? a : b; }
inline point max(point a, point b) { return a < b ? b : a; }
struct node {
  vector<point> MAX, MIN;
  point Max, Min;
  void merge(node L, node R) {
    Max = max(L.Max, R.Max);
    Min = min(L.Min, R.Min);
  }
} seg[2][4 * maxn];
void build(int k, int idx, int i, int j) {
  if (i == j) {
    sort(E[k][i].begin(), E[k][i].end());
    for (auto p : E[k][i]) {
      int val = p.first;
      int id = p.second;
      seg[k][idx].MAX.push_back({val, i, id});
      seg[k][idx].MIN.push_back({val, i, id});
    }
    reverse(seg[k][idx].MIN.begin(), seg[k][idx].MIN.end());
    if (!seg[k][idx].MAX.empty())
      seg[k][idx].Max = seg[k][idx].MAX.back();
    else
      seg[k][idx].Max = {0, 0, 0};
    if (!seg[k][idx].MIN.empty())
      seg[k][idx].Min = seg[k][idx].MIN.back();
    else
      seg[k][idx].Min = {n + 1, 0, 0};
    return;
  }
  int mid = (i + j) >> 1;
  int left = idx << 1;
  int right = left | 1;
  build(k, left, i, mid);
  build(k, right, mid + 1, j);
  seg[k][idx].merge(seg[k][left], seg[k][right]);
}
void update(int k, int idx, int i, int j, int pos, int type) {
  if (i == j) {
    if (!type) {
      seg[k][idx].MAX.pop_back();
      if (!seg[k][idx].MAX.empty())
        seg[k][idx].Max = seg[k][idx].MAX.back();
      else
        seg[k][idx].Max = {0, 0, 0};
    } else {
      seg[k][idx].MIN.pop_back();
      if (!seg[k][idx].MIN.empty())
        seg[k][idx].Min = seg[k][idx].MIN.back();
      else
        seg[k][idx].Min = {n + 1, 0, 0};
    }
    return;
  }
  int mid = (i + j) >> 1;
  int left = idx << 1;
  int right = left | 1;
  if (pos <= mid)
    update(k, left, i, mid, pos, type);
  else
    update(k, right, mid + 1, j, pos, type);
  seg[k][idx].merge(seg[k][left], seg[k][right]);
}
point query(int k, int idx, int i, int j, int l, int r, int type) {
  if (i > j || j < l || r < i || l > r)
    return !type ? point(0, 0, 0) : point(n + 1, 0, 0);
  if (l <= i && j <= r) return !type ? seg[k][idx].Max : seg[k][idx].Min;
  int mid = (i + j) >> 1;
  int left = idx << 1;
  int right = left | 1;
  point L = query(k, left, i, mid, l, r, type);
  point R = query(k, right, mid + 1, j, l, r, type);
  return !type ? max(L, R) : min(L, R);
}
void dfs(int k, int v, int par) {
  st[k][v] = ++cur[k];
  for (auto i : adj[k][v]) {
    int u = i.first;
    int id = i.second;
    if (u == par) continue;
    dfs(k, u, v);
  }
  ed[k][v] = cur[k];
}
void dfsBuild(int k, int v, int par) {
  for (auto i : adj[k][v]) {
    int u = i.first;
    int id = i.second;
    if (u == par) continue;
    dfsBuild(k, u, v);
    if (!k && id == IDX) continue;
    int L = min(st[k ^ 1][u], st[k ^ 1][v]);
    int R = max(st[k ^ 1][u], st[k ^ 1][v]);
    E[k ^ 1][L].push_back({R, id});
    E[k ^ 1][R].push_back({L, id});
  }
}
void solve() {
  for (int k = 0; k <= 1; ++k) dfs(k, 1, -1);
  for (int k = 0; k <= 1; ++k) dfsBuild(k, 1, -1);
  for (int k = 0; k <= 1; ++k) build(k, 1, 1, n);
  vector<int> idx;
  idx.push_back(IDX);
  int k = 0;
  while (!idx.empty()) {
    if (!k)
      printf("Blue\n");
    else
      printf("Red\n");
    sort(idx.begin(), idx.end());
    vector<int> vec;
    for (auto id : idx) {
      if (k)
        printf("%d ", id - (n - 1));
      else
        printf("%d ", id);
      int u = e[id].first;
      int v = e[id].second;
      int l = max(st[k][u], st[k][v]);
      int r = min(ed[k][u], ed[k][v]);
      for (int type = 0; type <= 1; ++type) {
        point q = query(k, 1, 1, n, l, r, type);
        while ((!type && q.x > r) || (type && q.x < l)) {
          int x = q.x;
          int y = q.y;
          int id = q.id;
          update(k, 1, 1, n, y, type);
          if (!mrk[id]) vec.push_back(id);
          mrk[id] = true;
          q = query(k, 1, 1, n, l, r, type);
        }
      }
    }
    printf("\n");
    idx.clear();
    for (auto id : vec) idx.push_back(id);
    k ^= 1;
  }
}
int main() {
  scanf("%d", &n);
  for (int k = 0; k <= 1; ++k)
    for (int i = 1; i <= n - 1; ++i) {
      int id = k * (n - 1) + i;
      int x;
      int y = i + 1;
      scanf("%d", &x);
      adj[k][x].push_back({y, id});
      adj[k][y].push_back({x, id});
      e[id] = {x, y};
    }
  scanf("%d", &IDX);
  solve();
  return 0;
}