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<stdio.h>
#include<memory.h>
#include<string>
using namespace std;
__int64 n,k,p;

int main()
{
  scanf("%I64d %I64d",&n,&k);
  scanf("%d",&p);

  //....xx.x.x.x.xxxx
  //....x.x.x.x.x.xxxxx
  __int64 dots=n-k;
  __int64 hvost=k-dots;//xxxxxx
  if(hvost<0)hvost=0;
  k-=hvost;
  //K>=dots
  __int64 leng=(k-2)*2;//.x.x.x.x.x
  if (leng<0)leng=0;
  __int64 afterprefix=0;
  __int64 prefix=0;
  __int64 dotsrem=dots;
  if(k-2>=0)dotsrem-=k-2;
  if(k>=2)k=2;
  if(dotsrem%2==0 && k==2 && dotsrem>=2)
  {
      leng+=4;
      k=0;
      dotsrem-=2;
      prefix=dotsrem;
  }
  else if(dotsrem%2==1)
  {
      afterprefix=k;
      prefix=dotsrem;
  }
  else if(dotsrem==0)
  {
      afterprefix=k;
  }
  else   if(dotsrem%2==0 && k<2 && dotsrem>=2)
  {
     prefix=dotsrem;
     afterprefix=k;
  }
  //prefix|afterprefix|leng|hvost
  string answ;
  for(int i=0;i<p;i++)
  {
      __int64 slt;
      scanf("%I64d",&slt);
      if(slt<=prefix)
      {
          answ.push_back('.');
          continue;
      }
      else slt-=prefix;
      if(slt<=afterprefix)
      {
          answ.push_back('X');
           continue;
      }
      else slt-=afterprefix;
      if(slt<=leng)
      {
          if(slt%2==1)
          {
              answ.push_back('.');
          }
          else answ.push_back('X');
           continue;
      }
      else slt-=leng;
      answ.push_back('X');
  }
  printf("%s\n",answ.c_str());

}