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.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class P4 {

	public static void main(String[] args) throws Exception {
		new P4().run();
	}

	public void run() throws Exception {
		long n = getLong();
		long k = getLong();
		int p = getInt();
		StringBuffer sb = new StringBuffer();
		if (n-k>k) {
			if((n-k+1)/2>=k+(n-2*k)/2){
				for (int i = 0; i < p; i++) {
					long x = getLong();
					if (x<=n-k) {
						sb.append(".");
					} else {
						sb.append("X");
					}
				}
			}else{
				if(k>=2&&(n-2*k)%2==1){
					for (int i = 0; i < p; i++) {
						long x = getLong();
						if(x==n){
							sb.append("X");
						}else{
							if(x<=n-1-2*(k-1)){
								sb.append(".");
							}else{
								if((n-x)%2==0){
									sb.append(".");
								}else{
									sb.append("X");
								}
							}
						}
					}
				}else{
					for (int i = 0; i < p; i++) {
						long x = getLong();
						if(x<=n-2*k){
							sb.append(".");
						}else{
							if((x-(n-2*k))%2==1){
								sb.append(".");
							}else{
								sb.append("X");
							}
						}
					}
				}
				
			}
		} else if (n-k==k) {
			for (int i = 0; i < p; i++) {
				long x = getLong();
				if (x % 2 == 1) {
					sb.append(".");
				} else {
					sb.append("X");
				}
			}
		}else{
			for(int i=0;i<p;i++){
				long x=getLong();
				if(x>2*(n-k)){
					sb.append("X");
				}else{
					if(x%2==1){
						sb.append(".");
					}else{
						sb.append("X");
					}
				}
			}
		}
		System.out.println(sb.toString());
	}

	private StringTokenizer token = null;
	private BufferedReader reader = new BufferedReader(new InputStreamReader(
			System.in));

	public int getInt() throws Exception {
		return Integer.valueOf(getStringTokenizer().nextToken());
	}

	public long getLong() throws Exception {
		return Long.valueOf(getStringTokenizer().nextToken());
	}

	public double getDouble() throws Exception {
		return Double.valueOf(getStringTokenizer().nextToken());
	}

	public String getString() throws Exception {
		return reader.readLine();
	}

	public StringTokenizer getStringTokenizer() throws Exception {
		if (token == null || !token.hasMoreTokens()) {
			String str = reader.readLine();
			token = new StringTokenizer(str);
		}
		return token;
	}

}
