Strip 2#2330

Strip 2

1 second
64 megabytes
Medium

A vertically positioned rectangular paper strip with the lower end fixed is folded as follows:

After all folds are completed, the strip is unfolded back to its original state. The folds leave creases (edges): some edges are protruding towards you (K-edges), others away from you (O-edges). The edges are numbered from top to bottom from to 2^n-1.

Write a program that, given the sequence of uppercase letters "P" and "Z" determining the types of folds, and the numbers of specified edges, outputs the type of those edges after performing this operation sequence.

Input

The first line contains the integer – the number of folds (n \leq 60). The second line contains a sequence of uppercase Latin letters "P" and "Z". The third line begins with the integer – the number of specified edges (k \leq 10), followed by their numbers (from to 2^n-1).

Output

Output a single line containing uppercase Latin letters ("K" or "O") – the types of the specified edges.

Examples

Example 1

Loading
Loading