7 7 7
1
2
3
4
5
6
7
 4 2 8
1
3
4
2
3
4
1
2
 9 4 9
1
2
3
4
5
6
7
8
9
 7 5 7
1
2
3
4
5
6
7
 15 10 15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 4 0 4
1
2
3
4
 12 2 12
1
2
3
4
5
6
7
8
9
10
11
12
 10 2 10
1
2
3
4
5
6
7
8
9
10
 7 4 7
1
2
3
4
5
6
7
 7 3 7
1
2
3
4
5
6
7

XXXXXXX
 ..XX.X.X
 ...X.X.XX
 .X.XXXX
 .X.X.X.X.XXXXXX
 ....
 .........X.X
 .......X.X
 .X.X.XX
 ...X.XX

#include <bits/stdc++.h>
using namespace std;
long long n, k, p;
int main() {
  cin >> n >> k >> p;
  long long b, len;
  long long r, l, re;
  l = -1;
  r = n + 1;
  while (r - l > 1) {
    re = ((l + r) >> 1);
    if (((n - re) >> 1) < k - re)
      l = re;
    else
      r = re;
  }
  b = n + 1 - r;
  if (((b - 1) & 1) == 1 && k > 0) b--;
  l = 0;
  r = n + 1;
  while (r - l > 1) {
    re = ((l + r) >> 1);
    if (((re + 1) >> 1) > k - (n - b + 1))
      r = re;
    else
      l = re;
  }
  len = b - l;
  long long x;
  for (long long i = 0; i < p; i++) {
    cin >> x;
    if (x >= b)
      cout << "X";
    else if (x < len)
      cout << ".";
    else {
      if (((b - x) & 1) == 1)
        cout << "X";
      else
        cout << ".";
    }
  }
  cout << endl;
  return 0;
}
