#include <bits/stdc++.h>
int main() {
  long long n, k, a, b;
  int q;
  scanf("%lld %lld %d", &n, &k, &q);
  if (k <= 1)
    a = n - k, b = 0;
  else if (n - k <= 1)
    a = n - k, b = 0;
  else if (n - k <= k)
    a = 1, b = n - k - 1;
  else if (!(n & 1))
    a = n - 2 * k + 1, b = k - 1;
  else
    a = n - 2 * k + 2, b = k - 2;
  while (q--) {
    long long t;
    scanf("%lld", &t);
    if (t <= a)
      printf(".");
    else {
      t -= a;
      if (t <= 2 * b && !(t & 1))
        printf(".");
      else
        printf("X");
    }
  }
  return 0;
}
