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 N = 2e5 + 5;
const int inf = 1e9;
int n, idx, st[2][N], en[2][N], cnt, f[2][N];
pair<int, int> edge[2][N];
vector<int> g[2][N];
vector<pair<int, int> > Edge, Temp;
set<pair<int, int> > ele[2][N];
pair<int, int> it[2][2][4 * N];
pair<int, int> init[2];
bool inAns[2][N];
void update(int dir, int type, int k, int l, int r, int L, int R,
            pair<int, pair<int, int> > val) {
  if (r < L || R < l || L > R) return;
  if (L <= l && r <= R) {
    if (val.first == 0)
      ele[type][l].insert(val.second);
    else
      ele[type][l].erase(val.second);
    if (!dir) {
      if (!ele[type][l].empty())
        it[dir][type][k] = *ele[type][l].begin();
      else
        it[dir][type][k] = {inf, 0};
    } else {
      if (!ele[type][l].empty())
        it[dir][type][k] = *(--ele[type][l].end());
      else
        it[dir][type][k] = {0, 0};
    }
    return;
  }
  int md = (l + r) >> 1;
  update(dir, type, k << 1, l, md, L, R, val);
  update(dir, type, k << 1 | 1, md + 1, r, L, R, val);
  if (!dir)
    it[dir][type][k] = min(it[dir][type][k << 1], it[dir][type][k << 1 | 1]);
  else
    it[dir][type][k] = max(it[dir][type][k << 1], it[dir][type][k << 1 | 1]);
}
pair<int, int> get(int dir, int type, int k, int l, int r, int L, int R) {
  if (r < L || R < l || L > R) return init[dir];
  if (L <= l && r <= R) return it[dir][type][k];
  int md = (l + r) >> 1;
  if (!dir)
    return min(get(dir, type, k << 1, l, md, L, R),
               get(dir, type, k << 1 | 1, md + 1, r, L, R));
  else
    return max(get(dir, type, k << 1, l, md, L, R),
               get(dir, type, k << 1 | 1, md + 1, r, L, R));
}
void dfs(int type, int u, int p) {
  st[type][u] = ++cnt;
  for (int i = 0; i < g[type][u].size(); i++) {
    int v = g[type][u][i];
    if (v == p) continue;
    f[type][v] = f[type][u] + 1;
    dfs(type, v, u);
  }
  en[type][u] = cnt;
}
void print(int type) { cout << (type == 0 ? "Blue" : "Red") << "\n"; }
int main() {
  cin.tie(0), ios_base::sync_with_stdio(0);
  cin >> n;
  for (int type = 0; type < 2; type++) {
    for (int k = 0; k < 4 * n; k++) it[0][type][k] = {inf, 0};
  }
  init[0] = {inf, 0}, init[1] = {0, 0};
  for (int j = 0; j < 2; j++) {
    for (int i = 2; i <= n; i++) {
      int x;
      cin >> x;
      edge[j][i - 1] = {x, i};
      g[j][i].push_back(x);
      g[j][x].push_back(i);
    }
  }
  for (int j = 0; j < 2; j++) {
    cnt = 0;
    dfs(j, 1, 1);
  }
  for (int j = 0; j < 2; j++) {
    for (int i = 1; i < n; i++) {
      if (f[j][edge[j][i].first] > f[j][edge[j][i].second])
        swap(edge[j][i].first, edge[j][i].second);
    }
  }
  for (int j = 0; j < 2; j++) {
    for (int i = 1; i < n; i++) {
      int par = edge[1 - j][i].first, u = edge[1 - j][i].second;
      if (st[j][par] < st[j][u]) {
        update(0, j, 1, 1, n, st[j][u], st[j][u], {0, {st[j][par], i}});
        update(1, j, 1, 1, n, st[j][par], st[j][par], {0, {st[j][u], i}});
      } else {
        update(0, j, 1, 1, n, st[j][par], st[j][par], {0, {st[j][u], i}});
        update(1, j, 1, 1, n, st[j][u], st[j][u], {0, {st[j][par], i}});
      }
    }
  }
  cin >> idx;
  Edge.push_back({idx, 0});
  inAns[0][idx] = 1;
  while (Edge.size() > 0) {
    int type = Edge[0].second;
    print(type);
    for (int i = 0; i < Edge.size(); i++) cout << Edge[i].first << " ";
    cout << "\n";
    for (int i = 0; i < Edge.size(); i++) {
      idx = Edge[i].first;
      int par = edge[type][idx].first, u = edge[type][idx].second;
      while (1) {
        pair<int, int> ans = get(0, type, 1, 1, n, st[type][u], en[type][u]);
        if (ans.first > en[type][u] ||
            (st[type][u] <= ans.first && ans.first <= en[type][u]))
          break;
        else {
          if (!inAns[1 - type][ans.second])
            Temp.push_back({ans.second, 1 - type});
          inAns[1 - type][ans.second] = 1;
          if (st[type][edge[1 - type][ans.second].second] < st[type][u]) {
            update(0, type, 1, 1, n, st[type][edge[1 - type][ans.second].first],
                   st[type][edge[1 - type][ans.second].first], {inf, ans});
            update(1, type, 1, 1, n,
                   st[type][edge[1 - type][ans.second].second],
                   st[type][edge[1 - type][ans.second].second], {inf, ans});
          } else if (st[type][edge[1 - type][ans.second].first] < st[type][u]) {
            update(0, type, 1, 1, n,
                   st[type][edge[1 - type][ans.second].second],
                   st[type][edge[1 - type][ans.second].second], {inf, ans});
            update(1, type, 1, 1, n, st[type][edge[1 - type][ans.second].first],
                   st[type][edge[1 - type][ans.second].first], {inf, ans});
          }
        }
      }
      while (1) {
        pair<int, int> ans = get(1, type, 1, 1, n, st[type][u], en[type][u]);
        if (ans.first < st[type][u] ||
            (st[type][u] <= ans.first && ans.first <= en[type][u]))
          break;
        else {
          if (!inAns[1 - type][ans.second])
            Temp.push_back({ans.second, 1 - type});
          inAns[1 - type][ans.second] = 1;
          if (st[type][edge[1 - type][ans.second].second] > en[type][u]) {
            update(1, type, 1, 1, n, st[type][edge[1 - type][ans.second].first],
                   st[type][edge[1 - type][ans.second].first], {inf, ans});
            update(0, type, 1, 1, n,
                   st[type][edge[1 - type][ans.second].second],
                   st[type][edge[1 - type][ans.second].second], {inf, ans});
          } else if (st[type][edge[1 - type][ans.second].first] > en[type][u]) {
            update(1, type, 1, 1, n,
                   st[type][edge[1 - type][ans.second].second],
                   st[type][edge[1 - type][ans.second].second], {inf, ans});
            update(0, type, 1, 1, n, st[type][edge[1 - type][ans.second].first],
                   st[type][edge[1 - type][ans.second].first], {inf, ans});
          }
        }
      }
    }
    sort(Temp.begin(), Temp.end());
    Edge = Temp;
    Temp.clear();
  }
}