// Arup Guha
// 10/18/2014
// Solution to 1994 UCF HS Contest Problem: Where's the Bee?

import java.util.*;

public class beehive {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		boolean first = true;

		// Process all cases.
		while (stdin.hasNext()) {

			// Get line.
			StringTokenizer tok = new StringTokenizer(stdin.nextLine());

			// Set up initial grid.
			int[] cols = new int[tok.countTokens()];
			for (int i=0; i<cols.length; i++)
				cols[i] = Integer.parseInt(tok.nextToken());
			char[][] grid = getEmptyGrid(cols);

			// Put in queens.
			int numQueens = Integer.parseInt(stdin.nextLine().trim());
			for (int i=0; i<numQueens; i++) {
				tok = new StringTokenizer(stdin.nextLine());
				int y = Integer.parseInt(tok.nextToken())-1;
				int x = Integer.parseInt(tok.nextToken())-1;
				grid[2*x+1+y%2][2*y+1] = 'Q';
			}

			// Print case.
			if (!first) System.out.println();
			printGrid(grid);
			first = false;
		}
	}

	// Returns an empty grid with cells drawn based on cols.
	public static char[][] getEmptyGrid(int[] cols) {

		// Need to solve for this first.
		int maxRows = 0;
		for (int i=0; i<cols.length; i++) {
			int cur = i%2 == 0 ? 2*cols[i]+1 : 2*(cols[i]+1);
			maxRows = Math.max(maxRows, cur);
		}

		// This is the amount of space we need.
		char[][] grid = new char[maxRows][2*cols.length+1];
		for (int i=0; i<grid.length; i++)
			Arrays.fill(grid[i], ' ');

		// Fill by column.
		for (int i=0; i<cols.length; i++) {

			// All underscores.
			for (int j=i%2; j<=2*cols[i]+i%2; j+=2)
				grid[j][2*i+1] = '_';

			// Left side of grid.
			for (int j=1+i%2; j<2*cols[i]+i%2; j+=2) {
				grid[j][2*i] = '/';
				grid[j+1][2*i] = '\\';
			}

			// Right side of grid.
			for (int j=1+i%2; j<2*cols[i]+i%2; j+=2) {
				grid[j][2*i+2] = '\\';
				grid[j+1][2*i+2] = '/';
			}
		}

		return grid;
	}

	// Prints grid.
	public static void printGrid(char[][] grid) {
		for (int i=0; i<grid.length; i++) {
			for (int j=0; j<grid[i].length; j++)
				System.out.print(grid[i][j]);
			System.out.println();
		}
	}
}