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

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;

public class C implements Runnable {

    public void solve() throws IOException {
        long n = in.nextLong();
        long x = in.nextLong();
        long d = n - x;
        int p = in.nextInt();
        for ( int i = 0; i < p; i ++ ) {
            long q = in.nextLong();
            if ( q <= Math.max( 0, d - x ) ) {
                out.print( '.' );
            } else if ( q <= Math.max( 0, d - x ) + Math.min( d, x ) * 2 ) {
                out.print( "X.".charAt( ( int ) ( ( q - Math.max( 0, d - x ) ) & 1 ) ) );
            } else {
                out.print( "X" );
            }
        }
        out.println();
    }

    public Scanner in;

    public PrintWriter out;

    C() throws IOException {
        in = new Scanner(System.in);
        // in = new StreamTokenizer( new InputStreamReader( System.in ) );
        out = new PrintWriter(System.out);
    }

//    int nextInt() throws IOException {
//        in.nextToken();
//        return ( int ) in.nval;
//    }

    void check(boolean f, String msg) {
        if (!f) {
            out.close();
            throw new RuntimeException(msg);
        }
    }

    void close() throws IOException {
        out.close();
    }

    public void run() {
        try {
            solve();
            close();
        } catch (Exception e) {
            e.printStackTrace(out);
            out.flush();
            throw new RuntimeException(e);
        }
    }

    public static void main(String[] args) throws IOException {
        new Thread(new C()).start();
    }
}