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 + 2;
vector<int> adjb[N], adjr[N];
int inb[N], outb[N], inr[N], outr[N], nowb = 0, nowr = 0;
bool usedb[N], usedr[N];
pair<int, int> edgeb[N], edger[N];
vector<int> lis;
vector<int> itbf[4 * N], itbs[4 * N], itrf[4 * N], itrs[4 * N];
queue<pair<int, char> > lis1;
void dfsb(int x) {
  nowb++;
  inb[x] = nowb;
  for (int i = 0; i < adjb[x].size(); i++) {
    dfsb(adjb[x][i]);
  }
  outb[x] = nowb;
}
void dfsr(int x) {
  nowr++;
  inr[x] = nowr;
  for (int i = 0; i < adjr[x].size(); i++) {
    dfsr(adjr[x][i]);
  }
  outr[x] = nowr;
}
void addbf(int idx, int l, int r, int pos, int id) {
  if (l > pos || r < pos) {
    return;
  }
  itbf[idx].push_back(id);
  if (l == r) {
    return;
  }
  addbf(2 * idx, l, (l + r) / 2, pos, id);
  addbf(2 * idx + 1, (l + r) / 2 + 1, r, pos, id);
}
void addbs(int idx, int l, int r, int pos, int id) {
  if (l > pos || r < pos) {
    return;
  }
  itbs[idx].push_back(id);
  if (l == r) {
    return;
  }
  addbs(2 * idx, l, (l + r) / 2, pos, id);
  addbs(2 * idx + 1, (l + r) / 2 + 1, r, pos, id);
}
void addrf(int idx, int l, int r, int pos, int id) {
  if (l > pos || r < pos) {
    return;
  }
  itrf[idx].push_back(id);
  if (l == r) {
    return;
  }
  addrf(2 * idx, l, (l + r) / 2, pos, id);
  addrf(2 * idx + 1, (l + r) / 2 + 1, r, pos, id);
}
void addrs(int idx, int l, int r, int pos, int id) {
  if (l > pos || r < pos) {
    return;
  }
  itrs[idx].push_back(id);
  if (l == r) {
    return;
  }
  addrs(2 * idx, l, (l + r) / 2, pos, id);
  addrs(2 * idx + 1, (l + r) / 2 + 1, r, pos, id);
}
void querybf(int idx, int l, int r, int lef, int rig) {
  if (l > rig || r < lef) {
    return;
  }
  if (l >= lef && r <= rig) {
    while (itbf[idx].size() && max(inb[edger[itbf[idx].back()].first],
                                   inb[edger[itbf[idx].back()].second]) > rig) {
      if (!usedr[itbf[idx].back()]) {
        usedr[itbf[idx].back()] = true;
        lis1.push({itbf[idx].back(), 'R'});
      }
      itbf[idx].pop_back();
    }
    return;
  }
  querybf(2 * idx, l, (l + r) / 2, lef, rig);
  querybf(2 * idx + 1, (l + r) / 2 + 1, r, lef, rig);
}
void querybs(int idx, int l, int r, int lef, int rig) {
  if (l > rig || r < lef) {
    return;
  }
  if (l >= lef && r <= rig) {
    while (itbs[idx].size() && min(inb[edger[itbs[idx].back()].first],
                                   inb[edger[itbs[idx].back()].second]) < lef) {
      if (!usedr[itbs[idx].back()]) {
        usedr[itbs[idx].back()] = true;
        lis1.push({itbs[idx].back(), 'R'});
      }
      itbs[idx].pop_back();
    }
    return;
  }
  querybs(2 * idx, l, (l + r) / 2, lef, rig);
  querybs(2 * idx + 1, (l + r) / 2 + 1, r, lef, rig);
}
void queryrf(int idx, int l, int r, int lef, int rig) {
  if (l > rig || r < lef) {
    return;
  }
  if (l >= lef && r <= rig) {
    while (itrf[idx].size() && max(inr[edgeb[itrf[idx].back()].first],
                                   inr[edgeb[itrf[idx].back()].second]) > rig) {
      if (!usedb[itrf[idx].back()]) {
        usedb[itrf[idx].back()] = true;
        lis1.push({itrf[idx].back(), 'B'});
      }
      itrf[idx].pop_back();
    }
    return;
  }
  queryrf(2 * idx, l, (l + r) / 2, lef, rig);
  queryrf(2 * idx + 1, (l + r) / 2 + 1, r, lef, rig);
}
void queryrs(int idx, int l, int r, int lef, int rig) {
  if (l > rig || r < lef) {
    return;
  }
  if (l >= lef && r <= rig) {
    while (itrs[idx].size() && min(inr[edgeb[itrs[idx].back()].first],
                                   inr[edgeb[itrs[idx].back()].second]) < lef) {
      if (!usedb[itrs[idx].back()]) {
        usedb[itrs[idx].back()] = true;
        lis1.push({itrs[idx].back(), 'B'});
      }
      itrs[idx].pop_back();
    }
    return;
  }
  queryrs(2 * idx, l, (l + r) / 2, lef, rig);
  queryrs(2 * idx + 1, (l + r) / 2 + 1, r, lef, rig);
}
signed main() {
  int n, i, j, k, l, r, x1;
  cin >> n;
  for (i = 2; i <= n; i++) {
    cin >> j;
    adjb[j].push_back(i);
    edgeb[i - 1] = {j, i};
  }
  for (i = 2; i <= n; i++) {
    cin >> j;
    adjr[j].push_back(i);
    edger[i - 1] = {j, i};
  }
  dfsb(1);
  dfsr(1);
  for (i = 1; i < n; i++) {
    lis.push_back(i);
  }
  sort(lis.begin(), lis.end(), [&](int x, int y) {
    return max(inb[edger[x].first], inb[edger[x].second]) <
           max(inb[edger[y].first], inb[edger[y].second]);
  });
  for (i = 0; i < lis.size(); i++) {
    k = min(inb[edger[lis[i]].first], inb[edger[lis[i]].second]);
    addbf(1, 1, n, k, lis[i]);
  }
  sort(lis.begin(), lis.end(), [&](int x, int y) {
    return min(inb[edger[x].first], inb[edger[x].second]) >
           min(inb[edger[y].first], inb[edger[y].second]);
  });
  for (i = 0; i < lis.size(); i++) {
    j = max(inb[edger[lis[i]].first], inb[edger[lis[i]].second]);
    addbs(1, 1, n, j, lis[i]);
  }
  sort(lis.begin(), lis.end(), [&](int x, int y) {
    return max(inr[edgeb[x].first], inr[edgeb[x].second]) <
           max(inr[edgeb[y].first], inr[edgeb[y].second]);
  });
  for (i = 0; i < lis.size(); i++) {
    k = min(inr[edgeb[lis[i]].first], inr[edgeb[lis[i]].second]);
    addrf(1, 1, n, k, lis[i]);
  }
  sort(lis.begin(), lis.end(), [&](int x, int y) {
    return min(inr[edgeb[x].first], inr[edgeb[x].second]) >
           min(inr[edgeb[y].first], inr[edgeb[y].second]);
  });
  for (i = 0; i < lis.size(); i++) {
    j = max(inr[edgeb[lis[i]].first], inr[edgeb[lis[i]].second]);
    addrs(1, 1, n, j, lis[i]);
  }
  cin >> j;
  usedb[j] = true;
  lis1.push({j, 'B'});
  char x;
  while (lis1.size()) {
    vector<pair<int, char> > ans_lis;
    x = lis1.front().second;
    while (lis1.size() && lis1.front().second == x) {
      x1 = lis1.front().first;
      if (x == 'B') {
        l = inb[edgeb[x1].second];
        r = outb[edgeb[x1].second];
        querybf(1, 1, n, l, r);
        querybs(1, 1, n, l, r);
      } else {
        l = inr[edger[x1].second];
        r = outr[edger[x1].second];
        queryrf(1, 1, n, l, r);
        queryrs(1, 1, n, l, r);
      }
      ans_lis.push_back(lis1.front());
      lis1.pop();
    }
    sort(ans_lis.begin(), ans_lis.end());
    if (x == 'B') {
      cout << "Blue\n";
      for (i = 0; i < ans_lis.size(); i++) {
        cout << ans_lis[i].first << ' ';
      }
      cout << '\n';
    } else {
      cout << "Red\n";
      for (i = 0; i < ans_lis.size(); i++) {
        cout << ans_lis[i].first << ' ';
      }
      cout << '\n';
    }
  }
}