description: The only difference between this problem and D1 is that you don't have to provide the way to construct the answer in D1, but you have to do it in this problem.
  
  There's a table of n × m cells (n rows and m columns). The value of n ⋅ m is even.
  
  A domino is a figure that consists of two cells having a common side. It may be horizontal (one of the cells is to the right of the other) or vertical (one of the cells is above the other).
  
  You need to place nm/2 dominoes on the table so that exactly k of them are horizontal and all the other dominoes are vertical. The dominoes cannot overlap and must fill the whole table.
  
  Input
  
  The first line contains one integer t (1 ≤ t ≤ 10) — the number of test cases. Then t test cases follow.
  
  Each test case consists of a single line. The line contains three integers n, m, k (1 ≤ n,m ≤ 100, 0 ≤ k ≤ nm/2, n ⋅ m is even) — the count of rows, columns and horizontal dominoes, respectively.
  
  Output
  
  For each test case:
  
    * print "NO" if it's not possible to place the dominoes on the table in the described way; 
    * otherwise, print "YES" on a separate line, then print n lines so that each of them contains m lowercase letters of the Latin alphabet — the layout of the dominoes on the table. Each cell of the table must be marked by the letter so that for every two cells having a common side, they are marked by the same letters if and only if they are occupied by the same domino. I.e. both cells of the same domino must be marked with the same letter, but two dominoes that share a side must be marked with different letters. If there are multiple solutions, print any of them. 
  
  Example
  
  Input
  
  
  8
  4 4 2
  2 3 0
  3 2 3
  1 2 0
  2 4 2
  5 2 2
  2 17 16
  2 1 1
  
  
  Output
  
  
  YES
  accx
  aegx
  bega
  bdda
  YES
  aha
  aha
  YES
  zz
  aa
  zz
  NO
  YES
  aaza
  bbza
  NO
  YES
  bbaabbaabbaabbaay
  ddccddccddccddccy
  NO
solution: import java.util.*;
  import java.io.*;
  import java.math.*;
  
  
  /**
   * @author Naitik
   * 
   */
  public class Main
  
  { 
  	 static FastReader sc=new FastReader(); 
  	 static long dp[][];
  	 static int mod=1000000007;
  	 static int mod1=998244353;
  	 static int max;
  	 static long bit[];
  	 static long seg[];
  
  	   static PrintWriter out=new PrintWriter(System.out);
  	  public static void main(String[] args)
  {
  		    //CHECK FOR N=1
  	       	//CHECK FOR N=1
  		   //StringBuffer sb=new StringBuffer("");
  		  int ttt=1;
  		      ttt =i();
  	        outer :while (ttt-- > 0) 
  			{
  	        	int n=i();
  	        	int m=i();
  	        	int k=i();
  	        	int A[][]=new int[n][m];
  	        	int c=1;
  	        	if(n%2==0) {
  	        		if(m%2==0) {
  	        		if(k%2==0) {
  	        			System.out.println("YES");
  	        			for(int j=0;j<m;j+=2) {
  	        				for(int i=0;i<n;i+=2) {
  	        					if(k==0)
  	        						break;
  	        					A[i][j]=c;
  	        					A[i][j+1]=c;
  	        					c++;
  	        					A[i+1][j]=c;
  	        					A[i+1][j+1]=c;
  	        					c++;
  	        					k-=2;
  	        					if(k==0)
  	        						break;
  	        				}
  	        				if(k==0)
  	        					break;
  	        			}
  	        		}
  	        		else {
  	        			System.out.println("NO");
  	        			continue;
  	        		}
  	        		}
  	        		else {
  	        			int y=n/2;
  	        			int tot=(m*n)/2;
  	        			int min=tot-y;
  	        			if(k>min) {
  	        				System.out.println("NO");
  	        				continue;
  	        			}
  	        			if(k%2==0) {
  		        			System.out.println("YES");
  		        			for(int j=0;j<m-1;j+=2) {
  		        				for(int i=0;i<n;i+=2) {
  		        					if(k==0)
  		        						break;
  		        					A[i][j]=c;
  		        					A[i][j+1]=c;
  		        					c++;
  		        					A[i+1][j]=c;
  		        					A[i+1][j+1]=c;
  		        					c++;
  		        					k-=2;
  		        					if(k==0)
  		        						break;
  		        				}
  		        				if(k==0)
  		        					break;
  		        			}
  		        		}
  		        		else {
  		        			System.out.println("NO");
  		        			continue;
  		        		}
  	        			
  	        		}
  	        	}
  	        	else {
  	        	int min=m/2;
  	        	if(k<min) {
  	        		System.out.println("NO");
  	        		continue;
  	        	}
      			for(int j=0;j<m;j+=2) {
      				A[0][j]=c;
      				A[0][j+1]=c;
      				c++;
      			}
  	        	int y=k;
  	        	k-=min;
  	        	if(k%2==0) {
          			System.out.println("YES");
          			for(int j=0;j<m-1;j+=2) {
          				for(int i=1;i<n;i+=2) {
          					if(k==0)
          						break;
          					A[i][j]=c;
          					A[i][j+1]=c;
          					c++;
          					A[i+1][j]=c;
          					A[i+1][j+1]=c;
          					c++;
          					k-=2;
          					if(k==0)
          						break;
          				}
          				if(k==0)
          					break;
          			}
          			
          		}
          		else {
          			System.out.println("NO");
          			continue;
          		}
  	        	}
  	        	for(int j=0;j<m;j++) {
  	        		for(int i=0;i<n;i++) {
  	        			if(A[i][j]==0) {
  	        				A[i][j]=c;
  	        				A[i+1][j]=c;
  	        				c++;
  	        			}
  	        		}
  	        	}
  	        	char B[][]=new char[n][m];
  	        	for(int i=0;i<n;i++) {
  	        		for(int j=0;j<m;j++) {
  	        			if(j+1<m && A[i][j]==A[i][j+1]) {
  	        				for(char ch='a';ch<='z';ch++) {
  	        					B[i][j]=ch;
  	        					B[i][j+1]=ch;
  	        					boolean res=gor(B, i, j);
  	        					boolean res1=gol(B, i, j+1);
  	        					if(res&& res1) {
  	        						break;
  	        					}
  	        				}
  	        				continue;
  	        			}
  	        			if(i+1<n && A[i][j]==A[i+1][j]) {
  	        				for(char ch='a';ch<='z';ch++) {
  	        					B[i][j]=ch;
  	        					B[i+1][j]=ch;
  	        					boolean res=god(B, i, j);
  	        					boolean res1=gou(B, i+1, j);
  	        					if(res&& res1) {
  	        						break;
  	        					}
  	        				}
  	        			}
  	        		}
  	        	}
  	        	for(int i=0;i<n;i++) {
  	        		for(int j=0;j<m;j++) {
  	        			out.print(B[i][j]);
  	        		}
  	        		out.println();
  	        	}
  	        	out.flush();
  	        	
  	        	
  	        }
  	        //System.out.println(sb.toString());
  		     out.close();
  	     
  	     
  	    //CHECK FOR N=1                    //CHECK FOR M=0
          //CHECK FOR N=1                    //CHECK FOR M=0
         	//CHECK FOR N=1
         	
  		        
  		     
      }
  	  static boolean god(char A[][],int i,int j) {
  		  char ch=A[i][j];
  		  if(i-1>=0 && A[i-1][j]==ch)
  			  return false;
  		  if(j-1>=0 && A[i][j-1]==ch)
  			  return false;
  //		  if(i+1<A.length && A[i+1][j]==ch)
  //			  return false;
  		  if(j+1<A[0].length && A[i][j+1]==ch)
  			  return false;
  		  return true;
  		  
  	  }
  	  static boolean gou(char A[][],int i,int j) {
  		  char ch=A[i][j];
  //		  if(i-1>=0 && A[i-1][j]==ch)
  //			  return false;
  		  if(j-1>=0 && A[i][j-1]==ch)
  			  return false;
  		  if(i+1<A.length && A[i+1][j]==ch)
  			  return false;
  		  if(j+1<A[0].length && A[i][j+1]==ch)
  			  return false;
  		  return true;
  		  
  	  }
  	  static boolean gor(char A[][],int i,int j) {
  		  char ch=A[i][j];
  		  if(i-1>=0 && A[i-1][j]==ch)
  			  return false;
  		  if(j-1>=0 && A[i][j-1]==ch)
  			  return false;
  		  if(i+1<A.length && A[i+1][j]==ch)
  			  return false;
  //		  if(j+1<A[0].length && A[i][j+1]==ch)
  //			  return false;
  		  return true;
  		  
  	  }
  	  static boolean gol(char A[][],int i,int j) {
  		  char ch=A[i][j];
  		  if(i-1>=0 && A[i-1][j]==ch)
  			  return false;
  //		  if(j-1>=0 && A[i][j-1]==ch)
  //			  return false;
  		  if(i+1<A.length && A[i+1][j]==ch)
  			  return false;
  		  if(j+1<A[0].length && A[i][j+1]==ch)
  			  return false;
  		  return true;
  		  
  	  }
  	 
  	 
  	  
  	  
  static class Pair implements Comparable<Pair>
       {
      	 int x;
      	 int y;
      	 Pair(int x,int y){
      		 this.x=x;
      		 this.y=y;
      		 
      	 }
  		@Override
  		public int compareTo(Pair o) {
  			if(this.x>o.x)
  				return 1;
  			else if(this.x<o.x)
  				return -1;
  			else {
  				if(this.y>o.y)
  					return 1;
  				else if(this.y<o.y)
  					return -1;
  				else
  					return 0;
  			}
  		}
  //		public int hashCode() 
  //		{ 
  //			final int temp = 14; 
  //			int ans = 1; 
  //			ans =x*31+y*13; 
  //			return ans; 
  //		} 
  //		@Override
  //		public boolean equals(Object o) 
  //		{ 
  //			if (this == o) { 
  //				return true; 
  //			} 
  //			if (o == null) { 
  //				return false; 
  //			} 
  //			if (this.getClass() != o.getClass()) { 
  //				return false; 
  //			} 
  //			Pair other = (Pair)o; 
  //			if (this.x != other.x || this.y!=other.y) { 
  //				return false; 
  //			} 
  //			return true; 
  //		} 	
  //		
  		/* FOR TREE MAP PAIR USE */
  		
  //		public int compareTo(Pair o) {
  // 			if (x > o.x) {
  // 				return 1;
  // 			}
  // 			if (x < o.x) {
  // 				return -1;
  // 			}
  // 			if (y > o.y) {
  // 				return 1;
  // 			}
  // 			if (y < o.y) {
  // 				return -1;
  // 			}
  // 			return 0;
  // 		}
  		
       }
  //FENWICK TREE
  static void update(int i, int x){
  	for(; i < bit.length; i += (i&-i))
  		bit[i] += x;
  }
  
  static int sum(int i){
  	int ans = 0;
  	for(; i > 0; i -= (i&-i))
  		ans += bit[i];
  	return ans;
  }
  //END
  //static void add(int v) {
  //	if(!map.containsKey(v)) {
  //		map.put(v, 1);
  //	}
  //	else {
  //		map.put(v, map.get(v)+1);
  //	}
  //}
  //static void remove(int v) {
  //	if(map.containsKey(v)) {
  //		map.put(v, map.get(v)-1);
  //		if(map.get(v)==0)
  //			map.remove(v);
  //	}
  //}
  public static int upper(int A[],int k,int si,int ei)
  {
  	int l=si;
  	int u=ei;
  	int ans=-1;
  	while(l<=u) {
  		int mid=(l+u)/2;
  		if(A[mid]<=k) {
  			ans=mid;
  			l=mid+1;
  		}
  		else {
  			u=mid-1;
  		}
  	}
  	return ans;
  }
  public static int lower(int A[],int k,int si,int ei)
  {
  	int l=si;
  	int u=ei;
  	int ans=-1;
  	while(l<=u) {
  		int mid=(l+u)/2;
  		if(A[mid]<k) {
  			l=mid+1;
  		}
  		else {
  			ans=mid;
  			u=mid-1;
  		}
  	}
  	return ans;
  	
      
  }
  static int[] copy(int A[]) {
  	int B[]=new int[A.length];
  	for(int i=0;i<A.length;i++) {
  		B[i]=A[i];
  	}
  	return B;
  }
  static long[] copy(long A[]) {
  	long B[]=new long[A.length];
  	for(int i=0;i<A.length;i++) {
  		B[i]=A[i];
  	}
  	return B;
  }
  static int[] input(int n) {
  	int A[]=new int[n];
  	   for(int i=0;i<n;i++) {
  		   A[i]=sc.nextInt();
  	   }
  	   return A;
     }
  static long[] inputL(int n) {
  	long A[]=new long[n];
  	   for(int i=0;i<n;i++) {
  		   A[i]=sc.nextLong();
  	   }
  	   return A;
     }
  static String[] inputS(int n) {
  	String A[]=new String[n];
  	   for(int i=0;i<n;i++) {
  		   A[i]=sc.next();
  	   }
  	   return A;
     }
  static long sum(int A[]) {
  	long sum=0;
  	for(int i : A) {
  		sum+=i;
  	}
  	return sum;
  }
  static long sum(long A[]) {
  	long sum=0;
  	for(long i : A) {
  		sum+=i;
  	}
  	return sum;
  }
  static void reverse(long A[]) {
  	int n=A.length;
  	long B[]=new long[n];
  	for(int i=0;i<n;i++) {
  		B[i]=A[n-i-1];
  	}
  	for(int i=0;i<n;i++)
  		A[i]=B[i];
  	
  }
  static void reverse(int A[]) {
  	int n=A.length;
  	int B[]=new int[n];
  	for(int i=0;i<n;i++) {
  		B[i]=A[n-i-1];
  	}
  	for(int i=0;i<n;i++)
  		A[i]=B[i];
  	
  }
  static void input(int A[],int B[]) {
  	   for(int i=0;i<A.length;i++) {
  		   A[i]=sc.nextInt();
  		   B[i]=sc.nextInt();
  	   }
  }
  static int[][] input(int n,int m){
  	int A[][]=new int[n][m];
  	for(int i=0;i<n;i++) {
  		for(int j=0;j<m;j++) {
  			A[i][j]=i();
  		}
  	}
  	return A;
  }
  static char[][] charinput(int n,int m){
  	char A[][]=new char[n][m];
  	for(int i=0;i<n;i++) {
  		String s=s();
  		for(int j=0;j<m;j++) {
  			A[i][j]=s.charAt(j);
  		}
  	}
  	return A;
  }
  static int find(int A[],int a) {
  	  if(A[a]==a)
  		  return a;
  	  return A[a]=find(A, A[a]);
  }
  static int max(int A[]) {
  	int max=Integer.MIN_VALUE;
  	for(int i=0;i<A.length;i++) {
  		max=Math.max(max, A[i]);
  	}
  	return max;
  }
  static int min(int A[]) {
  	int min=Integer.MAX_VALUE;
  	for(int i=0;i<A.length;i++) {
  		min=Math.min(min, A[i]);
  	}
  	return min;
  }
  static long max(long A[]) {
  	long max=Long.MIN_VALUE;
  	for(int i=0;i<A.length;i++) {
  		max=Math.max(max, A[i]);
  	}
  	return max;
  }
  static long min(long A[]) {
  	long min=Long.MAX_VALUE;
  	for(int i=0;i<A.length;i++) {
  		min=Math.min(min, A[i]);
  	}
  	return min;
  }
  static long [] prefix(long A[]) {
  	long p[]=new long[A.length];
  	p[0]=A[0];
  	for(int i=1;i<A.length;i++)
  		p[i]=p[i-1]+A[i];
  	return p;
  }
  static long [] prefix(int A[]) {
  	long p[]=new long[A.length];
  	p[0]=A[0];
  	for(int i=1;i<A.length;i++)
  		p[i]=p[i-1]+A[i];
  	return p;
  }
  static long [] suffix(long A[]) {
  	long p[]=new long[A.length];
  	p[A.length-1]=A[A.length-1];
  	for(int i=A.length-2;i>=0;i--)
  		p[i]=p[i+1]+A[i];
  	return p;
  }
  static long [] suffix(int A[]) {
  	long p[]=new long[A.length];
  	p[A.length-1]=A[A.length-1];
  	for(int i=A.length-2;i>=0;i--)
  		p[i]=p[i+1]+A[i];
  	return p;
  }
  static void fill(int dp[]) {
  	Arrays.fill(dp, -1);
  }
  static void fill(int dp[][]) {
  	for(int i=0;i<dp.length;i++)
  	Arrays.fill(dp[i], -1);
  }
  static void fill(int dp[][][]) {
  	for(int i=0;i<dp.length;i++) {
  		for(int j=0;j<dp[0].length;j++) {
  			Arrays.fill(dp[i][j],-1);
  		}
  	}
  }
  static void fill(int dp[][][][]) {
  	for(int i=0;i<dp.length;i++) {
  		for(int j=0;j<dp[0].length;j++) {
  			for(int k=0;k<dp[0][0].length;k++) {
  			Arrays.fill(dp[i][j][k],-1);
  			}
  		}
  	}
  }
  static void fill(long dp[]) {
  	Arrays.fill(dp, -1);
  }
  static void fill(long dp[][]) {
  	for(int i=0;i<dp.length;i++)
  	Arrays.fill(dp[i], -1);
  }
  static void fill(long dp[][][]) {
  	for(int i=0;i<dp.length;i++) {
  		for(int j=0;j<dp[0].length;j++) {
  			Arrays.fill(dp[i][j],-1);
  		}
  	}
  }
  static void fill(long dp[][][][]) {
  	for(int i=0;i<dp.length;i++) {
  		for(int j=0;j<dp[0].length;j++) {
  			for(int k=0;k<dp[0][0].length;k++) {
  			Arrays.fill(dp[i][j][k],-1);
  			}
  		}
  	}
  }
  static int min(int a,int b) {
  	return Math.min(a, b);
  }
  static int min(int a,int b,int c) {
  	return Math.min(a, Math.min(b, c));
  }
  static int min(int a,int b,int c,int d) {
  	return Math.min(a, Math.min(b, Math.min(c, d)));
  }
  static int max(int a,int b) {
  	return Math.max(a, b);
  }
  static int max(int a,int b,int c) {
  	return Math.max(a, Math.max(b, c));
  }
  static int max(int a,int b,int c,int d) {
  	return Math.max(a, Math.max(b, Math.max(c, d)));
  }
  static long min(long a,long b) {
  	return Math.min(a, b);
  }
  static long min(long a,long b,long c) {
  	return Math.min(a, Math.min(b, c));
  }
  static long min(long a,long b,long c,long d) {
  	return Math.min(a, Math.min(b, Math.min(c, d)));
  }
  static long max(long a,long b) {
  	return Math.max(a, b);
  }
  static long max(long a,long b,long c) {
  	return Math.max(a, Math.max(b, c));
  }
  static long max(long a,long b,long c,long d) {
  	return Math.max(a, Math.max(b, Math.max(c, d)));
  }
  
  static long power(long x, long y, long p)
  {
  
  	if(y==0)
  		return 1;
  	if(x==0)
  		return 0;
      long res = 1;
      x = x % p;
  
      while (y > 0) {
  
          if (y % 2 == 1)
              res = (res * x) % p;
  
          y = y >> 1; 
          x = (x * x) % p;
      }
  
      return res;
  }
  static void print(int A[]) {
  	for(int i : A) {
  		System.out.print(i+" ");
  	}
  	System.out.println();
  }
  static void print(long A[]) {
  	for(long i : A) {
  		System.out.print(i+" ");
  	}
  	System.out.println();
  }
  static long mod(long x) {
  	  return ((x%mod + mod)%mod);
  }
  static String reverse(String s) {
  	StringBuffer p=new StringBuffer(s);
  	p.reverse();
  	return p.toString();
  }
  
       static int i() {
      	 return sc.nextInt();
       }
       static String s() {
      	 return sc.next();
       }
       static long l() {
      	 return sc.nextLong();
       }  
       static void sort(int[] A){
          int n = A.length;
          Random rnd = new Random();
          for(int i=0; i<n; ++i){
              int tmp = A[i];
              int randomPos = i + rnd.nextInt(n-i);
              A[i] = A[randomPos];
              A[randomPos] = tmp;
          }
          Arrays.sort(A);
       }
       static void sort(long[] A){
  	        int n = A.length;
  	        Random rnd = new Random();
  	        for(int i=0; i<n; ++i){
  	            long tmp = A[i];
  	            int randomPos = i + rnd.nextInt(n-i);
  	            A[i] = A[randomPos];
  	            A[randomPos] = tmp;
  	        }
  	        Arrays.sort(A);
  	     }
    static String sort(String s) {
   	 Character ch[]=new Character[s.length()];
   	 for(int i=0;i<s.length();i++) {
   		 ch[i]=s.charAt(i);
   	 }
   	 Arrays.sort(ch);
   	 StringBuffer st=new StringBuffer("");
   	 for(int i=0;i<s.length();i++) {
   		 st.append(ch[i]);
   	 }
   	 return st.toString();
    }
    static HashMap<Integer,Integer> hash(int A[]){
  	  HashMap<Integer,Integer> map=new HashMap<Integer, Integer>();
  	  for(int i : A) {
  		  if(map.containsKey(i)) {
  			  map.put(i, map.get(i)+1);
  		  }
  		  else {
  			  map.put(i, 1);
  		  }
  	  }
  	  return map;
    }
    static TreeMap<Integer,Integer> tree(int A[]){
  	  TreeMap<Integer,Integer> map=new TreeMap<Integer, Integer>();
  	  for(int i : A) {
  		  if(map.containsKey(i)) {
  			  map.put(i, map.get(i)+1);
  		  }
  		  else {
  			  map.put(i, 1);
  		  }
  	  }
  	  return map;
    }
       static boolean prime(int n) 
  	    { 
  	        if (n <= 1) 
  	            return false; 
  	        if (n <= 3) 
  	            return true; 
  	        if (n % 2 == 0 || n % 3 == 0) 
  	            return false; 
  	        double sq=Math.sqrt(n);
  	  
  	        for (int i = 5; i <= sq; i = i + 6) 
  	            if (n % i == 0 || n % (i + 2) == 0) 
  	                return false; 
  	        return true; 
  	    } 
       static boolean prime(long n) 
  	    { 
  	        if (n <= 1) 
  	            return false; 
  	        if (n <= 3) 
  	            return true; 
  	        if (n % 2 == 0 || n % 3 == 0) 
  	            return false; 
  	        double sq=Math.sqrt(n);
  	  
  	        for (int i = 5; i <= sq; i = i + 6) 
  	            if (n % i == 0 || n % (i + 2) == 0) 
  	                return false; 
  	        return true; 
  	    } 
       static int gcd(int a, int b) 
       { 
           if (a == 0) 
               return b; 
           return gcd(b % a, a); 
       } 
       static long gcd(long a, long b) 
       { 
           if (a == 0) 
               return b; 
           return gcd(b % a, a); 
       } 
       
          
      static class FastReader 
      { 
          BufferedReader br; 
          StringTokenizer st; 
    
          public FastReader() 
          { 
              br = new BufferedReader(new
                       InputStreamReader(System.in)); 
          } 
    
          String next() 
          { 
              while (st == null || !st.hasMoreElements()) 
              { 
                  try
                  { 
                      st = new StringTokenizer(br.readLine()); 
                  } 
                  catch (IOException  e) 
                  { 
                      e.printStackTrace(); 
                  } 
              } 
              return st.nextToken(); 
          } 
    
          int nextInt() 
          { 
              return Integer.parseInt(next()); 
          } 
    
          long nextLong() 
          { 
              return Long.parseLong(next()); 
          } 
    
          double nextDouble() 
          { 
              return Double.parseDouble(next()); 
          } 
    
          String nextLine() 
          { 
              String str = ""; 
              try
              { 
                  str = br.readLine(); 
              } 
              catch (IOException e) 
              { 
                  e.printStackTrace(); 
              } 
              return str; 
          } 
      } 
  } 
  
  
  
  