Package for this problem was not updated by the problem writer or Codeforces administration after we’ve upgraded the judging servers. To adjust the time limit constraint, solution execution time will be multiplied by 2. For example, if your solution works for 400 ms on judging servers, then value 800 ms will be displayed and used to determine the verdict.

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ACM-ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

C. Russian Roulette

time limit per test

2 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputAfter all the events in Orlando we all know, Sasha and Roma decided to find out who is still the team's biggest loser. Thankfully, Masha found somewhere a revolver with a rotating cylinder of *n* bullet slots able to contain exactly *k* bullets, now the boys have a chance to resolve the problem once and for all.

Sasha selects any *k* out of *n* slots he wishes and puts bullets there. Roma spins the cylinder so that every of *n* possible cylinder's shifts is equiprobable. Then the game starts, the players take turns, Sasha starts: he puts the gun to his head and shoots. If there was no bullet in front of the trigger, the cylinder shifts by one position and the weapon is given to Roma for make the same move. The game continues until someone is shot, the survivor is the winner.

Sasha does not want to lose, so he must choose slots for bullets in such a way as to minimize the probability of its own loss. Of all the possible variant he wants to select the lexicographically minimal one, where an empty slot is lexicographically less than a charged one.

More formally, the cylinder of *n* bullet slots able to contain *k* bullets can be represented as a string of *n* characters. Exactly *k* of them are "X" (charged slots) and the others are "." (uncharged slots).

Let us describe the process of a shot. Suppose that the trigger is in front of the first character of the string (the first slot). If a shot doesn't kill anyone and the cylinder shifts, then the string shifts left. So the first character becomes the last one, the second character becomes the first one, and so on. But the trigger doesn't move. It will be in front of the first character of the resulting string.

Among all the strings that give the minimal probability of loss, Sasha choose the lexicographically minimal one. According to this very string, he charges the gun. You have to help Sasha to charge the gun. For that, each *x*_{i} query must be answered: is there a bullet in the positions *x*_{i}?

Input

The first line contains three integers *n*, *k* and *p* (1 ≤ *n* ≤ 10^{18}, 0 ≤ *k* ≤ *n*, 1 ≤ *p* ≤ 1000) — the number of slots in the cylinder, the number of bullets and the number of queries. Then follow *p* lines; they are the queries. Each line contains one integer *x*_{i} (1 ≤ *x*_{i} ≤ *n*) the number of slot to describe.

Please do not use the %lld specificator to read or write 64-bit numbers in С++. It is preferred to use cin, cout streams or the %I64d specificator.

Output

For each query print "." if the slot should be empty and "X" if the slot should be charged.

Examples

Input

3 1 3

1

2

3

Output

..X

Input

6 3 6

1

2

3

4

5

6

Output

.X.X.X

Input

5 2 5

1

2

3

4

5

Output

...XX

Note

The lexicographical comparison of is performed by the < operator in modern programming languages. The *a* string is lexicographically less that the *b* string, if there exists such *i* (1 ≤ *i* ≤ *n*), that *a*_{i} < *b*_{i}, and for any *j* (1 ≤ *j* < *i*) *a*_{j} = *b*_{j}.

Codeforces (c) Copyright 2010-2018 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jun/22/2018 10:31:12 (d1).

Desktop version, switch to mobile version.

User lists

Name |
---|