public static void solve(BufferedReader reader) throws IOException{
		long t=Long.parseLong(reader.readLine());
		log(t);
		String line = "";
		StringBuilder sb=new StringBuilder();
		
		for(int piter=1;piter<=t;piter++){
			line = reader.readLine();
			log(line);
			String[] strarr=line.split(" ");
			
			int r=Integer.parseInt(strarr[0]);
			int c=Integer.parseInt(strarr[1]);
			int m=Integer.parseInt(strarr[2]);

			char[][] b=new char[r][c];
			b[0][0]='c';
			if(r*c<=m){
				b=null;
			}else{
				int s=r*c-m;
				int curs=1;
				int[] start={0,0};
				ArrayList<int[]> ret=spread(b,start,curs,s);
				if(ret==null){
					b=null;
				}else{
					for(char[] row: b){
						for(int i=0;i<row.length;i++){
							if(row[i]==0){
								row[i]='*';
							}
						}
					}
				}
			}
			
			sb.append("Case "+piter+":");
			sb.append(System.lineSeparator());
			if(b==null){
				sb.append("Impossible");
				sb.append(System.lineSeparator());
			}else{
				for(char[] row:b){
					for(int i=0;i<row.length;i++){
						sb.append(row[i]);
					}
					sb.append(System.lineSeparator());
				}
			}
		}
		
		FileHelper.writeFile(OUTPUT, sb.toString());
		log(sb.toString());
	}