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 node {
  node* son[2];
  int d, id;
};
node STK[1000001], *head = STK;
int n;
void update(node* p) {
  if (!p) return;
  if (p->son[0] && p->son[1]) {
    int mark = p->son[0]->d > p->son[1]->d;
    p->d = p->son[mark]->d, p->id = p->son[mark]->id;
  } else if (p->son[0])
    p->d = p->son[0]->d, p->id = p->son[0]->id;
  else if (p->son[1])
    p->d = p->son[1]->d, p->id = p->son[1]->id;
}
node* Build_tree(int l, int r) {
  if (l > r) return 0;
  node* tmp = ++head;
  tmp->son[0] = tmp->son[1] = 0;
  tmp->d = 999999999, tmp->id = l;
  if (l == r) return tmp;
  int mid = (l + r) >> 1;
  tmp->son[0] = Build_tree(l, mid);
  tmp->son[1] = Build_tree(mid + 1, r);
  return tmp;
}
void Modify(node* p, int L, int R, int pos, int d) {
  if (L == R) {
    p->d = d, p->id = pos;
    return;
  }
  int mid = (L + R) >> 1;
  if (pos <= mid)
    Modify(p->son[0], L, mid, pos, d);
  else
    Modify(p->son[1], mid + 1, R, pos, d);
  update(p);
}
pair<int, int> Query(node* p, int L, int R, int l, int r) {
  if (L == l && R == r) return make_pair(p->d, p->id);
  int mid = (L + R) >> 1;
  if (r <= mid)
    return Query(p->son[0], L, mid, l, r);
  else if (l > mid)
    return Query(p->son[1], mid + 1, R, l, r);
  else
    return min(Query(p->son[0], L, mid, l, mid),
               Query(p->son[1], mid + 1, R, mid + 1, r));
}
struct Event {
  int L[200005], R[200005], pos[200005];
  int dfs_clock, d[200005][21], depth[200005];
  vector<int> E[200005];
  int px[200005], py[200005];
  bool Mark[200005];
  map<pair<int, int>, int> M, M2;
  vector<pair<int, int> > RevE[200005];
  vector<pair<int, int> >::iterator S[200005];
  node* Root;
  void dfs(int first, int fa, int deep) {
    L[first] = ++dfs_clock;
    pos[dfs_clock] = first;
    depth[first] = deep;
    d[first][0] = fa;
    for (int i = 1; i <= 20; i++) d[first][i] = d[d[first][i - 1]][i - 1];
    for (int i = 0; i < (int)E[first].size(); i++) {
      int to = E[first][i];
      if (!L[to]) dfs(to, first, deep + 1);
    }
    R[first] = dfs_clock;
  }
  int LCA(int first, int second) {
    if (first == second) return first;
    if (depth[first] < depth[second]) swap(first, second);
    for (int i = 20; i >= 0; i--)
      if (depth[d[first][i]] >= depth[second]) first = d[first][i];
    if (first == second) return first;
    for (int i = 20; i >= 0; i--)
      if (d[first][i] != d[second][i])
        first = d[first][i], second = d[second][i];
    return d[first][0];
  }
  void Read(int n, int* a, int* Rev) {
    for (int i = 1; i < n; i++) {
      int tmpx = a[i], tmpy = i + 1;
      E[tmpx].push_back(tmpy), E[tmpy].push_back(tmpx);
      M[make_pair(tmpx, tmpy)] = i, M[make_pair(tmpy, tmpx)] = i;
    }
    dfs_clock = 0;
    Root = Build_tree(1, n);
    dfs(1, 0, 1);
    for (int i = 1; i < n; i++) {
      int tmpx = Rev[i], tmpy = i + 1;
      M2[make_pair(tmpx, tmpy)] = i, M2[make_pair(tmpy, tmpx)] = i;
      int tmp = depth[LCA(tmpx, tmpy)];
      RevE[tmpx].push_back(make_pair(tmp, i));
      RevE[tmpy].push_back(make_pair(tmp, i));
      px[i] = tmpx, py[i] = tmpy;
    }
    for (int i = 1; i <= n; i++) {
      RevE[i].push_back(make_pair(999999999, 0));
      sort(RevE[i].begin(), RevE[i].end());
    }
    for (int i = 1; i <= n; i++)
      Modify(Root, 1, n, L[i], RevE[i].begin()->first);
    for (int i = 1; i <= n; i++) S[i] = RevE[i].begin();
  }
  void Cut(int first, int second) { Mark[M2[make_pair(first, second)]] = 1; }
  void Work(int first, int second, vector<pair<int, int> >& V) {
    if (d[second][0] == first) swap(first, second);
    while (1) {
      pair<int, int> tmp = Query(Root, 1, n, L[first], R[first]);
      if (tmp.first >= depth[first]) break;
      int tmps = S[pos[tmp.second]]->second;
      if (!Mark[tmps]) {
        Mark[tmps] = 1;
        V.push_back(make_pair(px[tmps], py[tmps]));
      }
      ++S[pos[tmp.second]];
      Modify(Root, 1, n, L[pos[tmp.second]], S[pos[tmp.second]]->first);
    }
  }
};
Event RED, BLUE;
int a[200001], b[200001];
int tops = 0;
int ans[200001];
int main() {
  int idx = 0;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) scanf("%d", &a[i]);
  for (int i = 1; i < n; i++) scanf("%d", &b[i]);
  scanf("%d", &idx);
  BLUE.Read(n, a, b);
  RED.Read(n, b, a);
  int tmpx = a[idx], tmpy = idx + 1;
  RED.Cut(tmpx, tmpy);
  vector<pair<int, int> > now, next;
  int flag = 0;
  now.push_back(make_pair(tmpx, tmpy));
  while (!now.empty()) {
    next.clear();
    if (!flag) {
      printf("Blue\n");
      tops = 0;
      for (int i = 0; i < (int)now.size(); i++) ans[++tops] = BLUE.M[now[i]];
      sort(ans + 1, ans + 1 + tops);
      for (int i = 1; i <= tops; i++) printf("%d ", ans[i]);
      printf("\n");
      for (int i = 0; i < (int)now.size(); i++)
        BLUE.Work(now[i].first, now[i].second, next);
    } else {
      printf("Red\n");
      tops = 0;
      for (int i = 0; i < (int)now.size(); i++) ans[++tops] = RED.M[now[i]];
      sort(ans + 1, ans + 1 + tops);
      for (int i = 1; i <= tops; i++) printf("%d ", ans[i]);
      printf("\n");
      for (int i = 0; i < (int)now.size(); i++)
        RED.Work(now[i].first, now[i].second, next);
    }
    swap(now, next);
    flag ^= 1;
  }
  return 0;
}