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;
struct IO {
  IO() {}
  inline bool is(char c) { return c >= '0' && c <= '9'; }
  inline int read() {
    char c;
    while (!is(c = getchar()))
      ;
    int num = c - '0';
    while (is(c = getchar())) num = num * 10 + c - '0';
    return num;
  }
  inline void out(int x) {
    if (x == 0) {
      printf("0 ");
      return;
    }
    char tmp[20];
    int cnt = 0;
    while (x) {
      tmp[cnt++] = x % 10 + '0';
      x /= 10;
    }
    for (int i = cnt - 1; i >= 0; i--) printf("%c", tmp[i]);
    printf(" ");
  }
} FAST;
const int N = 200005;
int n;
int off = 1, lo, hi;
vector<int> EDGE;
int LIJEVA, DESNA;
struct stabalce {
  vector<pair<int, int> > graf[200005];
  bool bio[200005];
  vector<pair<int, int> > T[(1 << 19) + 10];
  vector<pair<int, int> > V[(1 << 19) + 10];
  int disc[200005];
  int fin[200005];
  int depth[200005];
  int which_node[200005];
  int timer;
  pair<int, int> VEZE[200005];
  stabalce() { timer = -1; }
  void dfs(int node = 0, int par = -1, int dub = 0) {
    disc[node] = ++timer;
    which_node[timer] = node;
    depth[node] = dub;
    for (int i = 0; i < graf[node].size(); i++) {
      int sus = graf[node][i].first;
      if (sus != par) dfs(sus, node, dub + 1);
    }
    fin[node] = timer;
  }
  inline void merge(int node) {
    int cnt1 = 0, cnt2 = 0;
    int vel1 = (int)T[node * 2].size();
    int vel2 = (int)T[node * 2 + 1].size();
    for (;;) {
      if (cnt1 < vel1 && cnt2 < vel2) {
        if (T[node * 2][cnt1].first < T[node * 2 + 1][cnt2].first) {
          T[node].push_back(T[node * 2][cnt1]);
          cnt1++;
        } else {
          T[node].push_back(T[node * 2 + 1][cnt2]);
          cnt2++;
        }
      } else if (cnt1 < vel1)
        T[node].push_back(T[node * 2][cnt1]), cnt1++;
      else if (cnt2 < vel2)
        T[node].push_back(T[node * 2 + 1][cnt2]), cnt2++;
      else
        break;
    }
  }
  inline void ajmo(int node) {
    int cnt1 = 0, cnt2 = 0;
    int vel1 = (int)V[node * 2].size();
    int vel2 = (int)V[node * 2 + 1].size();
    for (;;) {
      if (cnt1 < vel1 && cnt2 < vel2) {
        if (V[node * 2][cnt1].first > V[node * 2 + 1][cnt2].first) {
          V[node].push_back(V[node * 2][cnt1]);
          cnt1++;
        } else {
          V[node].push_back(V[node * 2 + 1][cnt2]);
          cnt2++;
        }
      } else if (cnt1 < vel1)
        V[node].push_back(V[node * 2][cnt1]), cnt1++;
      else if (cnt2 < vel2)
        V[node].push_back(V[node * 2 + 1][cnt2]), cnt2++;
      else {
        break;
      }
    }
  }
  inline void init() {
    for (int i = off; i < off + off; i++) {
      sort(T[i].begin(), T[i].end());
      sort(V[i].begin(), V[i].end());
      reverse(V[i].begin(), V[i].end());
    }
    for (int i = off - 1; i >= 1; i--) merge(i), ajmo(i);
  }
  void query(int a, int b, int node) {
    if (a > hi || b < lo) return;
    if (a >= lo && b <= hi) {
      while (!V[node].empty()) {
        int na_kojeg = V[node].back().first;
        int idx = V[node].back().second;
        if (bio[idx]) {
          V[node].pop_back();
          continue;
        }
        if (na_kojeg >= LIJEVA) break;
        bio[idx] = 1;
        V[node].pop_back();
        EDGE.push_back(idx);
      }
      while (!T[node].empty()) {
        int na_kojeg = T[node].back().first;
        int idx = T[node].back().second;
        if (bio[idx]) {
          T[node].pop_back();
          continue;
        }
        if (na_kojeg <= DESNA) break;
        bio[idx] = 1;
        T[node].pop_back();
        EDGE.push_back(idx);
      }
      return;
    }
    query(a, (a + b) / 2, node * 2);
    query((a + b) / 2 + 1, b, node * 2 + 1);
  }
};
stabalce BLUE, RED;
inline void load() {
  scanf("%d", &n);
  for (int i = 1; i <= n - 1; i++) {
    int x;
    x = FAST.read();
    --x;
    BLUE.VEZE[i - 1].first = x;
    BLUE.VEZE[i - 1].second = i;
    BLUE.graf[x].push_back(make_pair(i, i - 1));
    BLUE.graf[i].push_back(make_pair(x, i - 1));
  }
  for (int i = 1; i <= n - 1; i++) {
    int x;
    x = FAST.read();
    --x;
    RED.graf[x].push_back(make_pair(i, i - 1));
    RED.graf[i].push_back(make_pair(x, i - 1));
    RED.VEZE[i - 1].first = x;
    RED.VEZE[i - 1].second = i;
  }
}
inline void solve() {
  while (off < n) off <<= 1;
  BLUE.dfs();
  RED.dfs();
  for (int i = 0; i < n; i++) {
    int koji_cvor = BLUE.which_node[i];
    if (RED.graf[koji_cvor].empty()) continue;
    for (int j = 0; j < RED.graf[koji_cvor].size(); j++) {
      int susjed = RED.graf[koji_cvor][j].first;
      int index = RED.graf[koji_cvor][j].second;
      int ovaj_izvana = BLUE.disc[susjed];
      BLUE.T[i + off].push_back(make_pair(ovaj_izvana, index));
      BLUE.V[i + off].push_back(make_pair(ovaj_izvana, index));
    }
  }
  for (int i = 0; i < n; i++) {
    int koji_cvor = RED.which_node[i];
    if (BLUE.graf[koji_cvor].empty()) continue;
    for (int j = 0; j < BLUE.graf[koji_cvor].size(); j++) {
      int susjed = BLUE.graf[koji_cvor][j].first;
      int index = BLUE.graf[koji_cvor][j].second;
      int ovaj_izvana = RED.disc[susjed];
      RED.T[i + off].push_back(make_pair(ovaj_izvana, index));
      RED.V[i + off].push_back(make_pair(ovaj_izvana, index));
    }
  }
  BLUE.init();
  RED.init();
  int za_heroje;
  scanf("%d", &za_heroje);
  za_heroje--;
  EDGE.push_back(za_heroje);
  RED.bio[za_heroje] = 1;
  for (int i = 0;; i++) {
    if (EDGE.empty()) break;
    vector<int> tmp;
    if (i % 2 == 0)
      printf("Blue\n");
    else
      printf("Red\n");
    sort(EDGE.begin(), EDGE.end());
    for (int j = 0; j < EDGE.size(); j++) FAST.out(EDGE[j] + 1);
    printf("\n");
    tmp = EDGE;
    EDGE.clear();
    for (int j = 0; j < tmp.size(); j++) {
      if (i % 2 == 0) {
        int node1 = BLUE.VEZE[tmp[j]].first;
        int node2 = BLUE.VEZE[tmp[j]].second;
        int dub1 = BLUE.depth[node1];
        int dub2 = BLUE.depth[node2];
        if (dub1 > dub2) swap(node1, node2);
        lo = BLUE.disc[node2];
        hi = BLUE.fin[node2];
        LIJEVA = lo;
        DESNA = hi;
        BLUE.query(0, off - 1, 1);
      } else {
        int node1 = RED.VEZE[tmp[j]].first;
        int node2 = RED.VEZE[tmp[j]].second;
        int dub1 = RED.depth[node1];
        int dub2 = RED.depth[node2];
        if (dub1 > dub2) swap(node1, node2);
        lo = RED.disc[node2];
        hi = RED.fin[node2];
        LIJEVA = lo;
        DESNA = hi;
        RED.query(0, off - 1, 1);
      }
    }
  }
}
int main(void) {
  load();
  solve();
  return 0;
}