// Arup Guha
// 5/19/2018
// Solution to 2018 Code Jam Round 2 Problem A: Falling Balls (commented later)

import java.util.*;

public class Solution {

	public static int n;
	public static int[] freq;
	public static ArrayList[] map;
	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int nC = stdin.nextInt();

		// Process each case.
		for (int loop=1; loop<=nC; loop++) {

			// Read in the frequencies.
			n = stdin.nextInt();
			freq = new int[n];
			for (int i=0; i<n; i++)
				freq[i] = stdin.nextInt();

			// Store which columns at the top will flow to which column at the bottom.
			// map[i] stores all columns from top that end at column i at the bottom.
			int idx = 0, minRow = 1;
			map = new ArrayList[n];
			for (int i=0; i<n; i++) {
				map[i] = new ArrayList<Integer>();
				for (int j=0; j<freq[i]; j++) {
					map[i].add(idx);
					minRow = Math.max(minRow, Math.abs(i-idx)+1);
					idx++;
				}
			}

			// Get the result.
			char[][] grid = solveIt(minRow);

			// Print it.
			if (grid == null)
				System.out.println("Case #"+loop+": IMPOSSIBLE");
			else {

				System.out.println("Case #"+loop+": "+minRow);
				for (int i=0; i<minRow; i++)
					System.out.println(new String(grid[i]));
			}
		}
	}

	public static char[][] solveIt(int minRow) {

		// Only time we can't do it.
		if (freq[0] == 0 || freq[n-1] == 0) return null;

		// Initially have no ramps.
		char[][] grid = new char[minRow][n];
		for (int i=0; i<minRow; i++) Arrays.fill(grid[i], '.');

		for (int i=0; i<map.length; i++) {

			// We place / or \ for each ball to get to its correct column.
			for (int j=0; j<map[i].size(); j++) {

				// See how far left or right this ball has to move.
				int cur = ((ArrayList<Integer>)map[i]).get(j);
				int diff = i-cur;

				// Ball goes right.
				if (diff > 0) {
					for (int k=0; k<diff; k++)
						grid[k][cur+k] = '\\';
				}
				
				// Ball goes left.
				else if (diff < 0) {
					for (int k=0; k<-diff; k++)
						grid[k][cur-k] = '/';
				}
			}
		}

		return grid;

	}
}