D. RGB Tree
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Imran owns a magical tree with $$$n$$$ nodes, where the root node is numbered $$$1$$$. Each node in this tree is colored either Red (R), Green (G), or Blue (B).

Imran has a magic wand that allows him to invert the colors of a node and all its descendants in the tree (i.e., the entire subtree rooted at that node). The color inversion follows this cyclic pattern:

$$$$$$\textbf{Red (R)} \to \textbf{Green (G)} \to \textbf{Blue (B)} \to \textbf{Red (R)}$$$$$$

Imran will perform $$$q$$$ operations on the tree. For each operation, he selects a node and uses his wand to invert the colors of all nodes in the subtree rooted at that node.

Your task is to determine the final color of each node after all $$$q$$$ operations have been completed.

Input

The first line contains a positive integer $$$n$$$ $$$(1 \leq n \leq 2 \cdot 10^5)$$$, representing the number of nodes in the tree.

The second line contains $$$n-1$$$ integers $$$p_i$$$ $$$(1 \leq p_i \leq n)$$$, where $$$p_i$$$ indicates the parent of node $$$i+1$$$ in the tree.

The third line is a string of length $$$n$$$ consisting of the characters R, G, and B, where the $$$i$$$-th character represents the initial color of the $$$i$$$-th node.

The fourth line contains a positive integer $$$q$$$ $$$(1 \leq q \leq 2 \cdot 10^5)$$$, representing the number of operations.

The next $$$q$$$ lines each contain a single integer $$$q_i$$$ $$$(1 \leq q_i \leq n)$$$, specifying the node on which the $$$i$$$-th operation is performed.

Output

Output a single string of length $$$n$$$, where the $$$i$$$-th character represents the final color of the $$$i$$$-th node after all operations.

Example
Input
7
1 1 2 3 3 2
RGBGRRB
4
5
1
2
7
Output
GRRRBGB
Note

After the 1st query, the tree becomes: RGBGGRB.

After the 2nd query, the tree becomes: GBRBBGR.

After the 3rd query, the tree becomes: GRRRBGG.

After the 4th query, the tree becomes: GRRRBGB.