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;
template <class T>
bool umin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool umax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
vector<int> b[200009], r[200009];
vector<pair<int, int> > upd[200009][2];
vector<int> last, now;
int blue[200009], red[200009], type = 1, TIM, vis[200009][2];
int bin[200009], bout[200009], rin[200009], rout[200009];
void dfsB(int nd, int pr) {
  bin[nd] = ++TIM;
  for (int i = 0; i < int(b[nd].size()); i++) {
    int to = b[nd][i];
    if (to == pr) continue;
    dfsB(to, nd);
  }
  bout[nd] = TIM;
}
void dfsR(int nd, int pr) {
  rin[nd] = ++TIM;
  for (int i = 0; i < int(r[nd].size()); i++) {
    int to = r[nd][i];
    if (to == pr) continue;
    dfsR(to, nd);
  }
  rout[nd] = TIM;
}
struct Two_Rooted_Tree {
  vector<pair<int, int> > s[200009 << 2];
  int st[200009 << 2], en[200009 << 2];
  void merge(int nd) {
    int p1 = 0, p2 = 0;
    int s1 = s[nd << 1].size();
    int s2 = s[nd << 1 | 1].size();
    st[nd] = 0;
    en[nd] = s1 + s2 - 1;
    while (p1 + p2 < s1 + s2) {
      if (p1 >= s1)
        s[nd].push_back(s[nd << 1 | 1][p2++]);
      else if (p2 >= s2)
        s[nd].push_back(s[nd << 1][p1++]);
      else if (s[nd << 1][p1] <= s[nd << 1 | 1][p2])
        s[nd].push_back(s[nd << 1][p1++]);
      else
        s[nd].push_back(s[nd << 1 | 1][p2++]);
    }
  }
  void build(int tp, int nd, int x, int y) {
    s[nd].clear();
    if (x == y) {
      st[nd] = 0;
      en[nd] = -1;
      for (__typeof((upd[x][tp]).begin()) it = (upd[x][tp]).begin();
           it != (upd[x][tp]).end(); it++) {
        s[nd].push_back(*it);
        en[nd]++;
      }
      sort(s[nd].begin(), s[nd].end());
      return;
    }
    int mid = (x + y) >> 1;
    build(tp, nd << 1, x, mid);
    build(tp, nd << 1 | 1, mid + 1, y);
    merge(nd);
  }
  void tap(int l, int r, int nd, int x, int y) {
    if (l > y or x > r) return;
    if (l <= x and y <= r) {
      while (st[nd] <= en[nd] and s[nd][st[nd]].first < l) {
        if (!vis[s[nd][st[nd]].second][type]) {
          vis[s[nd][st[nd]].second][type] = 1;
          now.push_back(s[nd][st[nd]].second);
        }
        st[nd]++;
      }
      while (st[nd] <= en[nd] and s[nd][en[nd]].first > r) {
        if (!vis[s[nd][en[nd]].second][type]) {
          vis[s[nd][en[nd]].second][type] = 1;
          now.push_back(s[nd][en[nd]].second);
        }
        en[nd]--;
      }
      return;
    }
    int mid = (x + y) >> 1;
    tap(l, r, nd << 1, x, mid);
    tap(l, r, nd << 1 | 1, mid + 1, y);
  }
} B, R;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d", blue + i);
    b[i + 1].push_back(blue[i]);
    b[blue[i]].push_back(i + 1);
  }
  for (int i = 1; i < n; i++) {
    scanf("%d", red + i);
    r[i + 1].push_back(red[i]);
    r[red[i]].push_back(i + 1);
  }
  dfsB(1, -1);
  TIM = 0;
  dfsR(1, -1);
  TIM = 0;
  for (int i = 1; i <= n; i++) {
    int u = i + 1;
    int v = blue[i];
    upd[rin[u]][1].push_back(make_pair(rin[v], i));
    upd[rin[v]][1].push_back(make_pair(rin[u], i));
  }
  for (int i = 1; i <= n; i++) {
    int u = i + 1;
    int v = red[i];
    upd[bin[u]][0].push_back(make_pair(bin[v], i));
    upd[bin[v]][0].push_back(make_pair(bin[u], i));
  }
  B.build(0, 1, 1, n);
  R.build(1, 1, 1, n);
  int ind;
  scanf("%d", &ind);
  last.push_back(ind);
  vis[ind][0] = 1;
  printf("Blue\n%d\n", ind);
  while (1) {
    for (int i = 0; i < int(last.size()); i++) {
      if (type) {
        int u = blue[last[i]];
        int v = last[i] + 1;
        if (bin[v] <= bin[u] and bout[u] <= bout[v]) swap(u, v);
        if (bin[u] <= bin[v] and bout[v] <= bout[u])
          B.tap(bin[v], bout[v], 1, 1, n);
      } else {
        int u = red[last[i]];
        int v = last[i] + 1;
        if (rin[v] <= rin[u] and rout[u] <= rout[v]) swap(u, v);
        if (rin[u] <= rin[v] and rout[v] <= rout[u])
          R.tap(rin[v], rout[v], 1, 1, n);
      }
    }
    if (now.size() == 0) break;
    sort(now.begin(), now.end());
    if (type)
      printf("Red\n");
    else
      printf("Blue\n");
    type = (1 - type);
    for (__typeof((now).begin()) it = (now).begin(); it != (now).end(); it++)
      printf("%d ", *it);
    puts("");
    swap(last, now);
    now.clear();
  }
  return 0;
}