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;
int n;
int a[200002];
int b[200002];
bool use[200002];
vector<pair<int, int> > delete_list;
bool already_deleted[2][200002];
class Tree {
 public:
  vector<int> v[200002];

 private:
  int ord[200002];
  int en[200002];
  int linkk[200002];
  int lcc[18][200002];
  int siz;
  int dep[200002];
  vector<pair<int, int> > seg[200002 * 4];
  int LEF[200002 * 4];

 public:
  Tree() {
    memset(LEF, 0, sizeof(LEF));
    siz = 0;
  }

 private:
  void LCA_init() {
    for (int i = 0; i + 1 < 18; i++) {
      for (int j = 0; j < n; j++) {
        if (lcc[i][j] == -1) {
          lcc[i + 1][j] = -1;
          continue;
        }
        lcc[i + 1][j] = lcc[i][lcc[i][j]];
      }
    }
  }
  int lca(int a, int b) {
    if (dep[a] < dep[b]) {
      swap(a, b);
    }
    for (int i = 0; i < 18; i++) {
      if (((dep[a] - dep[b]) >> i) & 1) {
        a = lcc[i][a];
      }
    }
    if (a == b) {
      return a;
    }
    for (int i = 18 - 1; i >= 0; i--) {
      if (lcc[i][a] != lcc[i][b]) {
        a = lcc[i][a];
        b = lcc[i][b];
      }
    }
    return lcc[0][a];
  }
  inline void dfs(int b, int h = 0, int pre = -1) {
    use[b] = true;
    ord[b] = siz;
    linkk[siz] = b;
    siz++;
    lcc[0][b] = pre;
    dep[b] = h;
    for (int i = 0; i < v[b].size(); i++) {
      if (use[v[b][i]] == false) {
        dfs(v[b][i], h + 1, b);
      }
    }
    en[b] = siz;
  }

 public:
  void init() {
    memset(use, false, sizeof(use));
    dfs(0);
    LCA_init();
  }

 private:
  inline void add(int b, int l, int r, int ll, pair<int, int> x) {
    while (1) {
      seg[b].push_back(x);
      if (l + 1 == r) {
        return;
      }
      if (ll < ((l + r) >> 1)) {
        r = (l + r) >> 1;
        b <<= 1;
        b++;
      } else {
        l = (l + r) >> 1;
        b <<= 1;
        b += 2;
      }
    }
  }
  pair<int, int> val;
  inline void query(int b, int l, int r, int &ll, int &rr) {
    if (r <= ll || rr <= l) {
      return;
    }
    if (ll <= l && r <= rr) {
      int SIZ = seg[b].size();
      while (LEF[b] < SIZ) {
        val = seg[b][LEF[b]];
        if (val.first < ll) {
          LEF[b]++;
          delete_list.emplace_back(
              make_pair(linkk[val.first], linkk[val.second]));
        } else {
          break;
        }
      }
      while (SIZ - 1 >= LEF[b] && seg[b].back().first >= rr) {
        delete_list.emplace_back(
            make_pair(linkk[seg[b].back().first], linkk[seg[b].back().second]));
        seg[b].pop_back();
        SIZ--;
      }
      return;
    }
    query((b << 1) + 1, l, (l + r) >> 1, ll, rr);
    query((b << 1) + 2, (l + r) >> 1, r, ll, rr);
  }

 public:
  void add_edge(int a, int b) {
    add(0, 0, siz, ord[a], make_pair(ord[b], ord[a]));
    add(0, 0, siz, ord[b], make_pair(ord[a], ord[b]));
  }
  void find_delible(int p, int q) {
    int lc = lca(p, q);
    if (lc == p) {
      lc = q;
    } else {
      lc = p;
    }
    query(0, 0, siz, ord[lc], en[lc]);
  }
  void init2() {
    for (int i = 0; i < 200002 * 4; i++) {
      if (!seg[i].empty()) sort(seg[i].begin(), seg[i].end());
    }
  }
};
Tree A;
Tree B;
bool w = false;
vector<int> outt;
void make() {
  int S = delete_list.size();
  outt.clear();
  int aa;
  int bb;
  for (int i = 0; i < S; i++) {
    aa = delete_list[i].first;
    bb = delete_list[i].second;
    if (w) {
      if (aa && a[aa - 1] == bb) {
        outt.push_back(aa);
      } else {
        outt.push_back(bb);
      }
    } else {
      if (aa && b[aa - 1] == bb) {
        outt.push_back(aa);
      } else {
        outt.push_back(bb);
      }
    }
  }
  sort(outt.begin(), outt.end());
  for (int i = 0; i < S; i++) {
    if (i) {
      printf(" ");
    }
    printf("%d", outt[i]);
  }
  puts("");
}
vector<pair<int, int> > copy_;
vector<pair<int, int> > cp;
int get_index(int aa, int bb) {
  if (w == false) {
    if (aa && a[aa - 1] == bb) {
      return aa;
    } else {
      return bb;
    }
  } else {
    if (aa && b[aa - 1] == bb) {
      return aa;
    } else {
      return bb;
    }
  }
  return -1;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i + 1 < n; i++) {
    scanf("%d", &a[i]);
    a[i]--;
    A.v[a[i]].push_back(i + 1);
    A.v[i + 1].push_back(a[i]);
  }
  for (int i = 0; i + 1 < n; i++) {
    scanf("%d", &b[i]);
    b[i]--;
    B.v[b[i]].push_back(i + 1);
    B.v[i + 1].push_back(b[i]);
  }
  A.init();
  B.init();
  for (int i = 0; i + 1 < n; i++) {
    A.add_edge(b[i], i + 1);
    B.add_edge(a[i], i + 1);
  }
  A.init2();
  B.init2();
  int ind;
  scanf("%d", &ind);
  ind--;
  cp.push_back(make_pair(ind + 1, a[ind]));
  already_deleted[w][ind + 1] = true;
  while (!cp.empty()) {
    if (w) {
      puts("Red");
    } else {
      puts("Blue");
    }
    w ^= true;
    swap(delete_list, cp);
    make();
    swap(delete_list, copy_);
    delete_list.clear();
    int S = copy_.size();
    int pre_index = 0;
    cp.clear();
    for (int i = 0; i < S; i++) {
      if (!w) {
        B.find_delible(copy_[i].first, copy_[i].second);
      } else {
        A.find_delible(copy_[i].first, copy_[i].second);
      }
      int nex_turn = delete_list.size();
      for (int j = pre_index; j < nex_turn; j++) {
        int R = get_index(delete_list[j].first, delete_list[j].second);
        if (already_deleted[w][R]) {
          continue;
        } else {
          already_deleted[w][R] = true;
        }
        cp.push_back(delete_list[j]);
      }
      pre_index = nex_turn;
    }
  }
  return 0;
}