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;
struct Edge {
  Edge(int x = -1, int y = -1, int id = -1) : x(x), y(y), id(id) {}
  int other(int tx) { return x + y - tx; }
  int x, y, id;
};
struct NodeV {
  NodeV(int st = -1, int en = -1, int id = -1) : st(st), en(en), id(id) {}
  int st, en, id;
};
struct Graph {
  Graph() {}
  Edge edge[MAXN];
  int cntEdge;
  vector<int> ng[MAXN];
  void addEdge(int x, int y) {
    int id = cntEdge++;
    ng[x].push_back(id);
    ng[y].push_back(id);
    edge[id] = Edge(x, y, id);
  }
  int dfsTime;
  int n;
  int stTime[MAXN], enTime[MAXN];
  void runDfs() {
    dfsTime = 0;
    dfs(0, -1);
  }
  void dfs(int x, int par) {
    stTime[x] = dfsTime++;
    for (int i = 0; i < ng[x].size(); i++) {
      int u = edge[ng[x][i]].other(x);
      if (u != par) dfs(u, x);
    }
    enTime[x] = dfsTime;
  }
  vector<int> delE(int eId) {
    int v = edge[eId].x;
    if (stTime[edge[eId].x] < stTime[edge[eId].y]) v = edge[eId].y;
    int ql = stTime[v], qr = enTime[v];
    askRet.clear();
    if (ql) askSeg(ql, 0, ql, qr, 1, 0, n, 0);
    if (qr < n) askSeg(qr, ql, qr, n, 1, 0, n, 1);
    return askRet;
  }
  bool remEdge[MAXN];
  vector<NodeV> seg[2][MAXN * 4];
  void addSeg(int ql, int qr, const NodeV& nd, int x, int s, int e, int id) {
    if (ql <= s && e <= qr) {
      seg[id][x].push_back(nd);
      return;
    }
    int mid = (s + e) >> 1;
    if (ql < mid) addSeg(ql, qr, nd, x * 2, s, mid, id);
    if (qr > mid) addSeg(ql, qr, nd, x * 2 + 1, mid, e, id);
  }
  vector<int> askRet;
  void askSeg(int plc, int ql, int qm, int qr, int x, int s, int e, int sid) {
    while (seg[sid][x].size() > 0 && seg[sid][x].back().st >= ql &&
           seg[sid][x].back().st < qm && seg[sid][x].back().en >= qm &&
           seg[sid][x].back().en < qr) {
      int id = seg[sid][x].back().id;
      if (!remEdge[id]) {
        remEdge[id] = true;
        askRet.push_back(id);
      }
      seg[sid][x].pop_back();
    }
    if (e - s < 2) return;
    int mid = (s + e) >> 1;
    if (plc < mid)
      askSeg(plc, ql, qm, qr, x * 2, s, mid, sid);
    else
      askSeg(plc, ql, qm, qr, x * 2 + 1, mid, e, sid);
  }
} g[2];
bool compEn(NodeV x, NodeV y) {
  return x.en == y.en ? x.st < y.st : x.en > y.en;
}
bool compSt(NodeV x, NodeV y) {
  return x.st == y.st ? x.en > y.en : x.st < y.st;
}
int main() {
  int n;
  scanf("%d", &n);
  g[0].n = g[1].n = n;
  for (int o = 0; o < 2; o++) {
    for (int i = 0; i < n - 1; i++) {
      int x;
      scanf("%d", &x);
      x--;
      g[o].addEdge(x, i + 1);
    }
    g[o].runDfs();
  }
  for (int id = 0; id < 2; id++) {
    vector<NodeV> cur;
    for (int i = 0; i < n - 1; i++) {
      const Edge& e = g[id].edge[i];
      cur.push_back(NodeV(g[id ^ 1].stTime[e.x], g[id ^ 1].stTime[e.y], e.id));
      if (cur.back().st >= cur.back().en) swap(cur.back().st, cur.back().en);
    }
    sort(cur.begin(), cur.end(), compEn);
    for (int i = 0; i < cur.size(); i++)
      g[id ^ 1].addSeg(cur[i].st + 1, cur[i].en + 1, cur[i], 1, 0, n, 0);
    sort(cur.begin(), cur.end(), compSt);
    for (int i = 0; i < cur.size(); i++)
      g[id ^ 1].addSeg(cur[i].st + 1, cur[i].en + 1, cur[i], 1, 0, n, 1);
  }
  vector<int> curRem[2];
  {
    int id;
    scanf("%d", &id);
    id--;
    curRem[0].push_back(id);
    g[1].remEdge[id] = true;
  }
  int id = 0;
  while (!curRem[id].empty()) {
    id ? printf("Red\n") : printf("Blue\n");
    for (int i = 0; i < curRem[id].size(); i++) {
      const Edge& e = g[id].edge[curRem[id][i]];
      printf("%d ", e.id + 1);
    }
    printf("\n");
    curRem[id ^ 1].clear();
    for (int i = 0; i < curRem[id].size(); i++) {
      const Edge& e = g[id].edge[curRem[id][i]];
      vector<int> tmp = g[id].delE(e.id);
      for (int j = 0; j < tmp.size(); j++) curRem[id ^ 1].push_back(tmp[j]);
    }
    sort(curRem[id ^ 1].begin(), curRem[id ^ 1].end());
    id ^= 1;
  }
  return 0;
}