import java.io.*;
import java.util.*;
import java.text.*;
import java.lang.*;
import java.math.*;

public class Main{
    static ArrayList[] adj=new ArrayList[30];
    static Vector<pair> f(int n , int m) {
    	boolean visited[][] = new boolean [n][m];
    	Vector<pair>v = new Vector<>();
    	int idx = 0;
    	while(v.size() < n * m) {
    		for(int i = 0 ; i < m -idx ; i++) {
    			if(!visited[idx][i]) {
    				v.add(new pair(idx,i));
    				visited[idx][i] = true;
    			}
    		}
    		for(int j = 0 ; j < n - idx ;j++ ) {
    			if(!visited[j][m - idx - 1]) {
    				v.add(new pair(j,m - idx - 1));
    				visited[j][m - idx - 1] = true;
    			}
    		}
    		for(int i = m - idx - 1 ; i >= idx ; i--) {
    			if(!visited[n - idx -1][i]) {
    				v.add(new pair(n - idx -1,i));
    				visited[n - idx - 1][i] = true;
    			}
    		}
    		for(int j = n - idx -1  ; j >= idx;j-- ) {
    			if(!visited[j][idx]) {
    				v.add(new pair(j,idx));
    				visited[j][idx] = true;
    			}
    		}
    		idx++;
    	}
    	return v;
    }
     public void solve () throws FileNotFoundException  {
    	InputReader in = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int t = in .nextInt();
        while(t-- > 0) {
        	int n = in.nextInt();
        	int m = in.nextInt();
        	int k = in.nextInt();
        	char s[][] = new char [n][m];
        	for(int i = 0 ; i < n ; i++) {
        		s[i] = in.nextLine().toCharArray();
        	}
        	Vector<pair>v = f(n,m);
        	int cnt  = 0;
        	for(int i = 0 ;i < n ;i ++) {
        		for(int j = 0 ; j < m ; j ++) {
        			if(s[i][j] == 'R') cnt++;
        		}
        	}
        	int get = cnt / k;
        	int idx = 0;
        	char ans[][] = new char[n][m];
        	int j = 0;
        	Vector<Character>c = new Vector<>();
        	for(int i = 0 ; i < 26 ;i++) {
        		c.add((char)(i+'a'));
        		c.add((char)(i+'A'));
        		if(i < 10) {
        			c.add((char)('0'+i));
        		}
        	}
        	for(; j < v.size() ;) {

        		pair p = v.get(j);
        		if(cnt  == 0 ) {
        			ans[p.x][p.y] = c.get(idx);
        			j++;
        			continue;
        		}
        		get = cnt / k;
        		int tmp = get;
        		while(tmp > 0) {
        			p = v.get(j);
        			ans[p.x][p.y] = c.get(idx);
        			if(s[p.x][p.y] == 'R') tmp--;
        			j++;
        		}
        		cnt -=get;
        		k--;
        		if(cnt != 0)
            		idx ++;
        	}
        	for(int i = 0 ;i < n ;i++) {
        		for( j = 0 ;j<m ;j ++) {
        			pw.print(ans[i][j]);
        		}
        		pw.println();
        	}
        }
        pw.flush();
        pw.close();
    }
    public static void main(String[] args) throws Exception {

        new Thread(null,new Runnable() {
            public void run() {
                    try {
						new Main().solve();
					} catch (FileNotFoundException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
            }
        },"1",1<<26).start();

    }

    static void debug(Object... o) {
        System.out.println(Arrays.deepToString(o));
        }

        static class InputReader
        {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream)
        {
            this.stream = stream;
        }
        public int snext()
        {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars)
            {
                curChar = 0;
                try
                {
                    snumChars = stream.read(buf);
                }
                catch (IOException e)
                {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt()
        {
            int c = snext();
            while (isSpaceChar(c))
            {
                c = snext();
            }
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong()
        {
            int c = snext();
            while (isSpaceChar(c))
            {
                c = snext();
            }
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n)
        {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
            {
                a[i] = nextInt();
            }
            return a;
        }

        public String readString()
        {
            int c = snext();
            while (isSpaceChar(c))
            {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do
            {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine()
        {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do
            {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c)
        {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c)
        {
            return c == '\n' || c == '\r' || c == -1;
        }

        public interface SpaceCharFilter
        {
            public boolean isSpaceChar(int ch);
        }
    }
        public static long mod = 1000000007;
        public static int d;
        public static int p;
        public static int q;
        public void extended(int a,int b) {
            if(b==0) {
                d=a;
                p=1;
                q=0;
            }
            else
            {
                extended(b,a%b);
                int temp=p;
                p=q;
                q=temp-(a/b)*q;
            }
        }

        public static long binaryExponentiation(long x,long n)
        {
            long result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=result * x;
                x=x*x;
                n=n/2;
            }
            return result;
        }

        public static long[] shuffle(long[] a,Random gen)
        {
            int n = a.length;
            for(int i=0;i<n;i++)
            {
                int ind = gen.nextInt(n-i)+i;
                long temp = a[ind];
                a[ind] = a[i];
                a[i] = temp;
            }
            return a;
        }

        public static void swap(int a, int b){
            int temp = a;
            a = b;
            b = temp;
        }

        public static HashSet<Integer> primeFactorization(int n)
        {
            HashSet<Integer> a =new HashSet<Integer>();
            for(int i=2;i*i<=n;i++)
            {
                while(n%i==0)
                {
                    a.add(i);
                    n/=i;
                }
            }
            if(n!=1)
                a.add(n);
            return a;
        }

        public static void sieve(boolean[] isPrime,int n)
        {
            for(int i=1;i<n;i++)
                isPrime[i] = true;

            isPrime[0] = false;
            isPrime[1] = false;

            for(int i=2;i*i<n;i++)
            {
                if(isPrime[i] == true)
                {
                    for(int j=(2*i);j<n;j+=i)
                        isPrime[j] = false;
                }
            }
        }

        public static long GCD(long n,long m)
        {
            if(m==0)
                return n;
            else
                return GCD(m,n%m);
        }
        public static long LCM (long a,long b) {
            return ((a*b)/(GCD(a,b)));
        }

        static class pair implements Comparable<pair>
        {
        	Integer x;
        	Integer y;

            pair(int x ,int y)
            {
                this.x=x;
                this.y=y;
            }

			public int compareTo(pair o) {
                int result = x.compareTo(o.x);
                if(result==0)
                    result = y.compareTo(o.y);

                return result;
            }

            public String toString()
            {
                return x+" "+y;
            }

            public boolean equals(Object o)
            {
                if (o instanceof pair)
                {
                    pair p = (pair)o;
                    return p.x == x && p.y == y ;
                }
                return false;
            }

            public int hashCode()
            {
                return new Double(x).hashCode()*31 + new Long(y).hashCode();
            }
        }
        public static int binaryExponentiation(int x,int n)
        {
            int result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=result * x;
                x=x*x;
                n=n/2;
            }
            return result;
        }

        public static int modularExponentiation(int x,int n,int M)
        {
            int result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=(result * x)%M;
                x=(x%M*x)%M;
                n=n/2;
            }
            return result;
        }

        public static long modularExponentiation(long x,long n,long M)
        {
            long result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=(result%M * x%M)%M;
                x=(x%M * x%M)%M;
                n=n/2;
            }
            return result;
        }

        public static long modInverse(int A,int M)
        {
            return modularExponentiation(A,M-2,M);
        }

        public static long modInverse(long A,long M)
        {
            return modularExponentiation(A,M-2,M);
        }

}


import java.io.*;
import java.util.*;
import java.text.*;
import java.lang.*;
import java.math.*;

public class Main{
    static ArrayList[] adj=new ArrayList[30];
    static Vector<pair> f(int n , int m) {
    	boolean visited[][] = new boolean [n][m];
    	Vector<pair>v = new Vector<>();
    	int idx = 0;
    	while(v.size() < n * m) {
    		for(int i = 0 ; i < m -idx ; i++) {
    			if(!visited[idx][i]) {
    				v.add(new pair(idx,i));
    				visited[idx][i] = true;
    			}
    		}
    		for(int j = 0 ; j < n - idx ;j++ ) {
    			if(!visited[j][m - idx - 1]) {
    				v.add(new pair(j,m - idx - 1));
    				visited[j][m - idx - 1] = true;
    			}
    		}
    		for(int i = m - idx - 1 ; i >= idx ; i--) {
    			if(!visited[n - idx -1][i]) {
    				v.add(new pair(n - idx -1,i));
    				visited[n - idx - 1][i] = true;
    			}
    		}
    		for(int j = n - idx -1  ; j >= idx;j-- ) {
    			if(!visited[j][idx]) {
    				v.add(new pair(j,idx));
    				visited[j][idx] = true;
    			}
    		}
    		idx++;
    	}
    	return v;
    }
     public void solve () throws FileNotFoundException  {
    	InputReader in = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int t = in .nextInt();
        while(t-- > 0) {
        	int n = in.nextInt();
        	int m = in.nextInt();
        	int k = in.nextInt();
        	char s[][] = new char [n][m];
        	for(int i = 0 ; i < n ; i++) {
        		s[i] = in.nextLine().toCharArray();
        	}
        	Vector<pair>v = f(n,m);
        	int cnt  = 0;
        	for(int i = 0 ;i < n ;i ++) {
        		for(int j = 0 ; j < m ; j ++) {
        			if(s[i][j] == 'R') cnt++;
        		}
        	}
        	int get = cnt / k;
        	int idx = 0;
        	char ans[][] = new char[n][m];
        	int j = 0;
        	Vector<Character>c = new Vector<>();
        	for(int i = 0 ; i < 26 ;i++) {
        		c.add((char)(i+'a'));
        		c.add((char)(i+'A'));
        		if(i < 10) {
        			c.add((char)('0'+i));
        		}
        	}
        	for(; j < v.size() ;) {

        		pair p = v.get(j);
        		if(cnt  == 0 ) {
        			ans[p.x][p.y] = c.get(idx);
        			j++;
        			continue;
        		}
        		get = cnt / k;
        		int tmp = get;
        		while(tmp > 0) {
        			p = v.get(j);
        			ans[p.x][p.y] = c.get(idx);
        			if(s[p.x][p.y] == 'R') tmp--;
        			j++;
        		}
        		idx ++;
        		cnt -=get;
        		k--;
        	}
        	for(int i = 0 ;i < n ;i++) {
        		for( j = 0 ;j<m ;j ++) {
        			pw.print(ans[i][j]);
        		}
        		pw.println();
        	}
        }
        pw.flush();
        pw.close();
    }
    public static void main(String[] args) throws Exception {

        new Thread(null,new Runnable() {
            public void run() {
                    try {
						new Main().solve();
					} catch (FileNotFoundException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
            }
        },"1",1<<26).start();

    }

    static void debug(Object... o) {
        System.out.println(Arrays.deepToString(o));
        }

        static class InputReader
        {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream)
        {
            this.stream = stream;
        }
        public int snext()
        {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars)
            {
                curChar = 0;
                try
                {
                    snumChars = stream.read(buf);
                }
                catch (IOException e)
                {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt()
        {
            int c = snext();
            while (isSpaceChar(c))
            {
                c = snext();
            }
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong()
        {
            int c = snext();
            while (isSpaceChar(c))
            {
                c = snext();
            }
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n)
        {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
            {
                a[i] = nextInt();
            }
            return a;
        }

        public String readString()
        {
            int c = snext();
            while (isSpaceChar(c))
            {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do
            {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine()
        {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do
            {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c)
        {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c)
        {
            return c == '\n' || c == '\r' || c == -1;
        }

        public interface SpaceCharFilter
        {
            public boolean isSpaceChar(int ch);
        }
    }
        public static long mod = 1000000007;
        public static int d;
        public static int p;
        public static int q;
        public void extended(int a,int b) {
            if(b==0) {
                d=a;
                p=1;
                q=0;
            }
            else
            {
                extended(b,a%b);
                int temp=p;
                p=q;
                q=temp-(a/b)*q;
            }
        }

        public static long binaryExponentiation(long x,long n)
        {
            long result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=result * x;
                x=x*x;
                n=n/2;
            }
            return result;
        }

        public static long[] shuffle(long[] a,Random gen)
        {
            int n = a.length;
            for(int i=0;i<n;i++)
            {
                int ind = gen.nextInt(n-i)+i;
                long temp = a[ind];
                a[ind] = a[i];
                a[i] = temp;
            }
            return a;
        }

        public static void swap(int a, int b){
            int temp = a;
            a = b;
            b = temp;
        }

        public static HashSet<Integer> primeFactorization(int n)
        {
            HashSet<Integer> a =new HashSet<Integer>();
            for(int i=2;i*i<=n;i++)
            {
                while(n%i==0)
                {
                    a.add(i);
                    n/=i;
                }
            }
            if(n!=1)
                a.add(n);
            return a;
        }

        public static void sieve(boolean[] isPrime,int n)
        {
            for(int i=1;i<n;i++)
                isPrime[i] = true;

            isPrime[0] = false;
            isPrime[1] = false;

            for(int i=2;i*i<n;i++)
            {
                if(isPrime[i] == true)
                {
                    for(int j=(2*i);j<n;j+=i)
                        isPrime[j] = false;
                }
            }
        }

        public static long GCD(long n,long m)
        {
            if(m==0)
                return n;
            else
                return GCD(m,n%m);
        }
        public static long LCM (long a,long b) {
            return ((a*b)/(GCD(a,b)));
        }

        static class pair implements Comparable<pair>
        {
        	Integer x;
        	Integer y;

            pair(int x ,int y)
            {
                this.x=x;
                this.y=y;
            }

			public int compareTo(pair o) {
                int result = x.compareTo(o.x);
                if(result==0)
                    result = y.compareTo(o.y);

                return result;
            }

            public String toString()
            {
                return x+" "+y;
            }

            public boolean equals(Object o)
            {
                if (o instanceof pair)
                {
                    pair p = (pair)o;
                    return p.x == x && p.y == y ;
                }
                return false;
            }

            public int hashCode()
            {
                return new Double(x).hashCode()*31 + new Long(y).hashCode();
            }
        }
        public static int binaryExponentiation(int x,int n)
        {
            int result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=result * x;
                x=x*x;
                n=n/2;
            }
            return result;
        }

        public static int modularExponentiation(int x,int n,int M)
        {
            int result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=(result * x)%M;
                x=(x%M*x)%M;
                n=n/2;
            }
            return result;
        }

        public static long modularExponentiation(long x,long n,long M)
        {
            long result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=(result%M * x%M)%M;
                x=(x%M * x%M)%M;
                n=n/2;
            }
            return result;
        }

        public static long modInverse(int A,int M)
        {
            return modularExponentiation(A,M-2,M);
        }

        public static long modInverse(long A,long M)
        {
            return modularExponentiation(A,M-2,M);
        }

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;
import java.util.*;

public class A3 {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        solve(in, out);
        out.close();
    }

    public static void solve(InputReader sc, PrintWriter pw) {
        int i,j=0;
        int t=sc.nextInt();
        char y[]=new char[62];
        for(i=0;i<10;i++)
            y[i]=(char)(i+'0');
        for(i=10;i<36;i++)
            y[i]=(char)(i-10+'a');
        for(i=36;i<62;i++)
            y[i]=(char)(i-36+'A');
        while(t-->0){
            int r=sc.nextInt();
            int c=sc.nextInt();
            int k=sc.nextInt();
            int a[][]=new int[r][c];
            int sum=0;
            for(i=0;i<r;i++){
                String s=sc.next();
                for(j=0;j<c;j++){
                    int h=(s.charAt(j)=='.')?0:1;
                    a[i][j]=h;
                    sum+=h;
                }
            }
            int min=sum/k;
            int d=sum%k;
            int max=(sum%k>0)?min+1:min;
            int o=0,cc=0;
            // pw.println(min+" "+max);
            for(i=0;i<r;i++){
                for(j=0;j<c;j++){
                    pw.print(y[Math.min(o,k-1)]);
                    if(a[i][j]==1)
                        cc++;
                    if((d>=1&&cc>=max)||(d<=0&&cc>=min)){
                        cc=0;
                        o++;
                        d--;
                    }

                }
                pw.println();
            }
        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;
import java.util.*;

public class A3 {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        solve(in, out);
        out.close();
    }

    public static void solve(InputReader sc, PrintWriter pw) {
        int i,j=0;
        int t=sc.nextInt();
        char y[]=new char[62];
        for(i=0;i<10;i++)
            y[i]=(char)(i+'0');
        for(i=10;i<36;i++)
            y[i]=(char)(i-10+'a');
        for(i=36;i<62;i++)
            y[i]=(char)(i-36+'A');
        while(t-->0){
            int r=sc.nextInt();
            int c=sc.nextInt();
            int k=sc.nextInt();
            int a[][]=new int[r][c];
            int sum=0;
            for(i=0;i<r;i++){
                String s=sc.next();
                for(j=0;j<c;j++){
                    int h=(s.charAt(j)=='.')?0:1;
                    a[i][j]=h;
                    sum+=h;
                }
            }
            int min=sum/k;
            int d=sum%k;
            int max=(sum%k>0)?min+1:min;
            int o=0,cc=0;
            char u[][]=new char[r][c];
            // pw.println(min+" "+max);
            int p=0;
            j=0;
            for(i=0;i<r;i++){
                r:for(;;){
                    u[i][j]=y[Math.min(o,k-1)];
                    // pw.print(y[Math.min(o,k-1)]);
                    if(a[i][j]==1)
                        cc++;
                    if((d>=1&&cc>=max)||(d<=0&&cc>=min)){
                        cc=0;
                        o++;
                        d--;
                    }
                    if(p==0){
                        j++;
                        if(j==c){
                            p=c-1;
                            j=p;
                            break r;
                        }
                    }
                    else{
                        j--;
                        if(j==-1){
                            p=0;
                            j=0;
                            break r;
                        }
                    }

                }
                // pw.println();
            }
            for(i=0;i<r;i++){
                for(j=0;j<c;j++){
                    pw.print(u[i][j]);
                }
                pw.println();
            }
        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
    }
}


import java.io.*;
import java.util.*;

public class Day9 {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter writer = new PrintWriter(System.out);
        char[] b = new char[100];
        int ind = 0;
        for(int i = (int)'0'; i <= (int)'9'; ++i){
            b[ind] = (char)(i);
            ++ind;
        }
        for(int i = (int)'A'; i <= (int)'Z'; ++i){
            b[ind] = (char)(i);
            ++ind;
        }
        for(int i = (int)'a'; i <= (int)'z'; ++i){
            b[ind] = (char)(i);
            ++ind;
        }
        int T = Integer.parseInt(reader.readLine());
        for(int q = 0; q < T; ++q){
            StringTokenizer st = new StringTokenizer(reader.readLine());
            int n = Integer.parseInt(st.nextToken());
            int m = Integer.parseInt(st.nextToken());
            int c = Integer.parseInt(st.nextToken());
            char[][] arr = new char[n][m];
            int count = 0;
            for(int i =0; i < n; ++i){
                char[] a = reader.readLine().toCharArray();
                for(int j = 0; j < m; ++j){
                    if(a[j] == 'R'){
                        ++count;
                    }
                    arr[i][j] = a[j];
                }
            }
            int min = count / c;
            int with = count - (count / c) * c;
            int x = 0;
            int y = 0;
            for(int num = 0; num < c; ++num){
                int found = 0;
                for(int i = x; i < n; ++i){
                    x = i;
                    if (i % 2 == 0) {
                        for(int j = y; j < m; ++j){
                            y = j;
                            if(arr[i][j] == 'R'){
                                ++found;
                            }
                            arr[i][j] = b[num];
                            if(found == min && num >= with){
                                ++y;
                                break;
                            }
                            if(found == min + 1){
                                ++y;
                                break;
                            }
                        }
                    }
                    else{
                        for(int j = y; j >= 0; --j){
                            y =  j;
                            if(arr[i][j] == 'R'){
                                ++found;
                            }
                            arr[i][j] = b[num];
                            if(found == min && num >= with){
                                y--;
                                break;
                            }
                            if(found == min + 1){
                                y--;
                                break;
                            }
                        }
                    }
                    if(found == min && num >= with){
                        break;
                    }
                    if(found == min + 1){
                        break;
                    }
                    y = Math.max(y, 0);
                    y = Math.min(m - 1, y);
                }
            }
            for(int i = x; i < n; ++i){
                x = i;
                if(i % 2 == 0){
                    for(int j = y; j < m; ++j){
                        y = j;
                        arr[i][j] = b[c - 1];
                    }
                }
                else{
                    for(int j = y; j >= 0; --j){
                        y = j;
                        arr[i][j] = b[c - 1];
                    }
                }
                y = Math.max(y, 0);
                y = Math.min(n - 1, y);
            }
            for(int i = 0; i < n; ++i){
                StringBuilder s = new StringBuilder();
                for(int j = 0; j < m; ++j){
                    s.append(arr[i][j]);
                }
                writer.println(s);
            }
        }
         writer.close();
    }
}


import java.io.*;
import java.util.*;

public class Day9 {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter writer = new PrintWriter(System.out);
        char[] b = new char[100];
        int ind = 0;
        for(int i = (int)'0'; i < (int)'9'; ++i){
            b[ind] = (char)(i);
            ++ind;
        }
        for(int i = (int)'A'; i < (int)'Z'; ++i){
            b[ind] = (char)(i);
            ++ind;
        }
        for(int i = (int)'a'; i < (int)'z'; ++i){
            b[ind] = (char)(i);
            ++ind;
        }
        int T = Integer.parseInt(reader.readLine());
        for(int q = 0; q < T; ++q){
            StringTokenizer st = new StringTokenizer(reader.readLine());
            int n = Integer.parseInt(st.nextToken());
            int m = Integer.parseInt(st.nextToken());
            int c = Integer.parseInt(st.nextToken());
            char[][] arr = new char[n][m];
            int count = 0;
            for(int i =0; i < n; ++i){
                char[] a = reader.readLine().toCharArray();
                for(int j = 0; j < m; ++j){
                    if(a[j] == 'R'){
                        ++count;
                    }
                    arr[i][j] = a[j];
                }
            }
            int min = count / c;
            int with = count - (count / c) * c;
            int x = 0;
            int y = 0;
            for(int num = 0; num < c; ++num){
                int found = 0;
                for(int i = x; i < n; ++i){
                    x = i;
                    if (i % 2 == 0) {
                        for(int j = y; j < m; ++j){
                            y = j;
                            if(arr[i][j] == 'R'){
                                ++found;
                            }
                            arr[i][j] = b[num];
                            if(found == min && num >= with){
                                ++y;
                                break;
                            }
                            if(found == min + 1){
                                ++y;
                                break;
                            }
                        }
                    }
                    else{
                        for(int j = y; j >= 0; --j){
                            y=  j;
                            if(arr[i][j] == 'R'){
                                ++found;
                            }
                            arr[i][j] = b[num];
                            if(found == min && num >= with){
                                y--;
                                break;
                            }
                            if(found == min + 1){
                                y--;
                                break;
                            }
                        }
                    }
                    if(found == min && num >= with){
                        break;
                    }
                    if(found == min + 1){
                        break;
                    }
                    y = Math.max(y, 0);
                    y = Math.min(m - 1, y);
                }
            }
            for(int i = x; i < n; ++i){
                x = i;
                if(i % 2 == 0){
                    for(int j = y; j < n; ++j){
                        y = j;
                        arr[i][j] = b[c - 1];
                    }
                }
                else{
                    for(int j = y; j >= 0; --j){
                        y = j;
                        arr[i][j] = b[c - 1];
                    }
                }
                y = Math.max(y, 0);
                y = Math.min(n - 1, y);
            }
            for(int i = 0; i < n; ++i){
                StringBuilder s = new StringBuilder();
                for(int j = 0; j < m; ++j){
                    s.append(arr[i][j]);
                }
                writer.println(s);
            }
        }
         writer.close();
    }
}


import java.io.*;
import java.util.*;

public class Day9 {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter writer = new PrintWriter(System.out);
        char[] b = new char[100];
        int ind = 0;
        for(int i = (int)'0'; i <= (int)'9'; ++i){
            b[ind] = (char)(i);
            ++ind;
        }
        for(int i = (int)'A'; i <= (int)'Z'; ++i){
            b[ind] = (char)(i);
            ++ind;
        }
        for(int i = (int)'a'; i <= (int)'z'; ++i){
            b[ind] = (char)(i);
            ++ind;
        }
        int T = Integer.parseInt(reader.readLine());
        for(int q = 0; q < T; ++q){
            StringTokenizer st = new StringTokenizer(reader.readLine());
            int n = Integer.parseInt(st.nextToken());
            int m = Integer.parseInt(st.nextToken());
            int c = Integer.parseInt(st.nextToken());
            char[][] arr = new char[n][m];
            int count = 0;
            for(int i =0; i < n; ++i){
                char[] a = reader.readLine().toCharArray();
                for(int j = 0; j < m; ++j){
                    if(a[j] == 'R'){
                        ++count;
                    }
                    arr[i][j] = a[j];
                }
            }
            int min = count / c;
            int with = count - (count / c) * c;
            int x = 0;
            int y = 0;
            for(int num = 0; num < c; ++num){
                int found = 0;
                for(int i = x; i < n; ++i){
                    x = i;
                    if (i % 2 == 0) {
                        for(int j = y; j < m; ++j){
                            y = j;
                            if(arr[i][j] == 'R'){
                                ++found;
                            }
                            arr[i][j] = b[num];
                            if(found == min && num >= with){
                                ++y;
                                break;
                            }
                            if(found == min + 1){
                                ++y;
                                break;
                            }
                        }
                    }
                    else{
                        for(int j = y; j >= 0; --j){
                            y =  j;
                            if(arr[i][j] == 'R'){
                                ++found;
                            }
                            arr[i][j] = b[num];
                            if(found == min && num >= with){
                                y--;
                                break;
                            }
                            if(found == min + 1){
                                y--;
                                break;
                            }
                        }
                    }
                    if(found == min && num >= with){
                        break;
                    }
                    if(found == min + 1){
                        break;
                    }
                    y = Math.max(y, 0);
                    y = Math.min(m - 1, y);
                }
            }
            for(int i = x; i < n; ++i){
                x = i;
                if(i % 2 == 0){
                    for(int j = y; j < m; ++j){
                        y = j;
                        arr[i][j] = b[c - 1];
                    }
                }
                else{
                    for(int j = y; j >= 0; --j){
                        y = j;
                        arr[i][j] = b[c - 1];
                    }
                }
                y = Math.max(y, 0);
                y = Math.min(m - 1, y);
            }
            for(int i = 0; i < n; ++i){
                StringBuilder s = new StringBuilder();
                for(int j = 0; j < m; ++j){
                    s.append(arr[i][j]);
                }
                writer.println(s);
            }
        }
         writer.close();
    }
}


import java.io.*;
import java.util.*;

public class Day9 {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter writer = new PrintWriter(System.out);
        char[] b = new char[100];
        int ind = 0;
        for(int i = (int)'0'; i <= (int)'9'; ++i){
            b[ind] = (char)(i);
            ++ind;
        }
        for(int i = (int)'A'; i <= (int)'Z'; ++i){
            b[ind] = (char)(i);
            ++ind;
        }
        for(int i = (int)'a'; i <= (int)'z'; ++i){
            b[ind] = (char)(i);
            ++ind;
        }
        int T = Integer.parseInt(reader.readLine());
        for(int q = 0; q < T; ++q){
            StringTokenizer st = new StringTokenizer(reader.readLine());
            int n = Integer.parseInt(st.nextToken());
            int m = Integer.parseInt(st.nextToken());
            int c = Integer.parseInt(st.nextToken());
            char[][] arr = new char[n][m];
            int count = 0;
            for(int i =0; i < n; ++i){
                char[] a = reader.readLine().toCharArray();
                for(int j = 0; j < m; ++j){
                    if(a[j] == 'R'){
                        ++count;
                    }
                    arr[i][j] = a[j];
                }
            }
            int min = count / c;
            int with = count - (count / c) * c;
            int x = 0;
            int y = 0;
            for(int num = 0; num < c; ++num){
                int found = 0;
                for(int i = x; i < n; ++i){
                    x = i;
                    if (i % 2 == 0) {
                        for(int j = y; j < m; ++j){
                            y = j;
                            if(arr[i][j] == 'R'){
                                ++found;
                            }
                            arr[i][j] = b[num];
                            if(found == min && num >= with){
                                ++y;
                                break;
                            }
                            if(found == min + 1){
                                ++y;
                                break;
                            }
                        }
                    }
                    else{
                        for(int j = y; j >= 0; --j){
                            y =  j;
                            if(arr[i][j] == 'R'){
                                ++found;
                            }
                            arr[i][j] = b[num];
                            if(found == min && num >= with){
                                y--;
                                break;
                            }
                            if(found == min + 1){
                                y--;
                                break;
                            }
                        }
                    }
                    if(found == min && num >= with){
                        break;
                    }
                    if(found == min + 1){
                        break;
                    }
                    y = Math.max(y, 0);
                    y = Math.min(m - 1, y);
                }
            }
            for(int i = x; i < n; ++i){
                x = i;
                if(i % 2 == 0){
                    for(int j = y; j < n; ++j){
                        y = j;
                        arr[i][j] = b[c - 1];
                    }
                }
                else{
                    for(int j = y; j >= 0; --j){
                        y = j;
                        arr[i][j] = b[c - 1];
                    }
                }
                y = Math.max(y, 0);
                y = Math.min(n - 1, y);
            }
            for(int i = 0; i < n; ++i){
                StringBuilder s = new StringBuilder();
                for(int j = 0; j < m; ++j){
                    s.append(arr[i][j]);
                }
                writer.println(s);
            }
        }
         writer.close();
    }
}


import java.io.*;
import java.math.*;
import java.util.*;
import java.awt.Point;

public class Main {
	//static final long MOD = 998244353L;
	//static final long INF = 100000000000007L;
	static final long MOD = 1000000007L;
	//static final int INF = 1000000007;

	public static void main(String[] args) {

		FastScanner sc = new FastScanner();
		PrintWriter pw = new PrintWriter(System.out);
		int Q = sc.ni();
		char[] chickens = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'};
		for (int q = 0; q < Q; q++) {
			int R = sc.ni();
			int C = sc.ni();
			int K = sc.ni();
			int[][] grid = new int[R][C];
			int rice = 0;
			for (int i = 0; i < R; i++) {
				String s = sc.next();
				for (int j = 0; j < C; j++) {
					if (s.charAt(j)=='R') {
						grid[i][j] = 1;
						rice++;
					}
				}
			}
			int X = rice/K;
			int A = rice - X*K; //how many chickens need X+1 rice
			int index = 0;
			char[][] ans = new char[R][C];
			int r = 0;
			int c = 0;
			int curRice = 0;
			while (r < R) {
				ans[r][c] = chickens[index];
				curRice += grid[r][c];
				if (index < A) {
					if (curRice == X+1) {
						index++;
						curRice = 0;
					}
				} else {
					if (curRice == X) {
						index++;
						curRice = 0;
					}
				}
				index = Math.min(index,K-1);
				if (r%2==0) {
					if (c==C-1) {
						r++;
					} else {
						c++;
					}
				} else {
					if (c==0) {
						r++;
					} else {
						c--;
					}
				}
			}
			for (char[] row: ans) {
				String s = String.valueOf(row);
				pw.println(s);
			}
		}
		pw.close();
 	}

	static class DisjointSetUnion {
		public int[] parent;
		public int[] weight;
		public int count;

		public DisjointSetUnion(int nodes) {
			count = nodes;
			parent = new int[nodes];
			weight = new int[nodes];
			for (int i = 0; i < nodes; i++) {
				parent[i] = i;
				weight[i] = 1;
			}
		}
		//"find"
		public int root(int p) {
			while (p != parent[p]) {
				p = parent[p];
			}
			return p;
		}

		//"union"
		public void connect(int p, int q) {
			int rootP = root(p);
			int rootQ = root(q);
			if (rootP == rootQ) return;
			if (weight[rootP] < weight[rootQ]) {
				parent[rootP] = rootQ;
				weight[rootQ] += weight[rootP];
			} else {
				parent[rootQ] = rootP;
				weight[rootP] += weight[rootQ];
			}
			count--;
		}

		public boolean connected(int p, int q) {
			return root(p) == root(q);
		}
	}

    public static long power(long x, long y, long p) {
        // Initialize result
        long res = 1;

        // Update x if it is more
        // than or equal to p
        x = x % p;

        while (y > 0)
        {
            // If y is odd, multiply x
            // with result
            if((y & 1)==1)
                res = (res * x) % p;

            // y must be even now
            // y = y / 2
            y = y >> 1;
            x = (x * x) % p;
        }
        return res;
    }

    public static long dist(int[] point, int[] point2) {
    	return (long)(Math.pow((point2[1]-point[1]),2)+Math.pow((point2[0]-point[0]),2));
    }

    public static long gcd(long a, long b) {
    	if (b == 0)
    		return a;
    	else
    		return gcd(b,a%b);
    }

    public static int[][] sort(int[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    int[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<int[]>() {
			  @Override
        	  public int compare(int[] arr1, int[] arr2) {
				  return arr2[2]-arr1[2]; //descending order
	          }
		});
		return array;
	}

    public static long[][] sort(long[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    long[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<long[]>() {
			  @Override
			  //Descending order
        	  public int compare(long[] arr1, long[] arr2) {
				  if (arr2[0] < arr1[0])
					  return -1;
				  if (arr2[0] > arr1[0])
					  return 1;
				  return 0;
	          }
		});
		return array;
	}

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            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 ni() {
            return Integer.parseInt(next());
        }

        long nl() {
            return Long.parseLong(next());
        }

        double nd() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.*;
import java.math.*;
import java.util.*;
import java.awt.Point;

public class Main {
	//static final long MOD = 998244353L;
	//static final long INF = 100000000000007L;
	static final long MOD = 1000000007L;
	//static final int INF = 1000000007;

	public static void main(String[] args) {

		FastScanner sc = new FastScanner();
		PrintWriter pw = new PrintWriter(System.out);
		int Q = sc.ni();
		char[] chickens = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'};
		for (int q = 0; q < Q; q++) {
			int R = sc.ni();
			int C = sc.ni();
			int K = sc.ni();
			int[][] grid = new int[R][C];
			int rice = 0;
			for (int i = 0; i < R; i++) {
				String s = sc.next();
				for (int j = 0; j < C; j++) {
					if (s.charAt(j)=='R') {
						grid[i][j] = 1;
						rice++;
					}
				}
			}
			int X = rice/K;
			int A = rice - X*K; //how many chickens need X+1 rice
			int index = 0;
			char[][] ans = new char[R][C];
			int r = 0;
			int c = 0;
			int curRice = 0;
			while (r < R) {
				ans[r][c] = chickens[index];
				curRice += grid[r][c];
				if (index < A) {
					if (curRice == X+1) {
						index++;
						curRice = 0;
					}
				} else {
					if (curRice == X) {
						index++;
						curRice = 0;
					}
				}
				if (r%2==0) {
					if (c==C-1) {
						r++;
					} else {
						c++;
					}
				} else {
					if (c==0) {
						r++;
					} else {
						c--;
					}
				}
			}
			for (char[] row: ans) {
				String s = String.valueOf(row, 0, C);
				pw.println(s);
			}
		}
		pw.close();
 	}

	static class DisjointSetUnion {
		public int[] parent;
		public int[] weight;
		public int count;

		public DisjointSetUnion(int nodes) {
			count = nodes;
			parent = new int[nodes];
			weight = new int[nodes];
			for (int i = 0; i < nodes; i++) {
				parent[i] = i;
				weight[i] = 1;
			}
		}
		//"find"
		public int root(int p) {
			while (p != parent[p]) {
				p = parent[p];
			}
			return p;
		}

		//"union"
		public void connect(int p, int q) {
			int rootP = root(p);
			int rootQ = root(q);
			if (rootP == rootQ) return;
			if (weight[rootP] < weight[rootQ]) {
				parent[rootP] = rootQ;
				weight[rootQ] += weight[rootP];
			} else {
				parent[rootQ] = rootP;
				weight[rootP] += weight[rootQ];
			}
			count--;
		}

		public boolean connected(int p, int q) {
			return root(p) == root(q);
		}
	}

    public static long power(long x, long y, long p) {
        // Initialize result
        long res = 1;

        // Update x if it is more
        // than or equal to p
        x = x % p;

        while (y > 0)
        {
            // If y is odd, multiply x
            // with result
            if((y & 1)==1)
                res = (res * x) % p;

            // y must be even now
            // y = y / 2
            y = y >> 1;
            x = (x * x) % p;
        }
        return res;
    }

    public static long dist(int[] point, int[] point2) {
    	return (long)(Math.pow((point2[1]-point[1]),2)+Math.pow((point2[0]-point[0]),2));
    }

    public static long gcd(long a, long b) {
    	if (b == 0)
    		return a;
    	else
    		return gcd(b,a%b);
    }

    public static int[][] sort(int[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    int[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<int[]>() {
			  @Override
        	  public int compare(int[] arr1, int[] arr2) {
				  return arr2[2]-arr1[2]; //descending order
	          }
		});
		return array;
	}

    public static long[][] sort(long[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    long[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<long[]>() {
			  @Override
			  //Descending order
        	  public int compare(long[] arr1, long[] arr2) {
				  if (arr2[0] < arr1[0])
					  return -1;
				  if (arr2[0] > arr1[0])
					  return 1;
				  return 0;
	          }
		});
		return array;
	}

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            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 ni() {
            return Integer.parseInt(next());
        }

        long nl() {
            return Long.parseLong(next());
        }

        double nd() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
If I'm the sun, you're the moon
Because when I go up, you go down
*******************************
*/
import java.util.*;
import java.io.*;
import java.math.*;

   public class x1255D
   {
      public static void main(String omkar[]) throws Exception
      {
         //BufferedReader infile = new BufferedReader(new FileReader("cowdate.in"));
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));
         StringTokenizer st;
         int T = Integer.parseInt(infile.readLine());
         String ap = "qazwsxedcrfvtgbyhnujmiklop";
         char[] tags = new char[62];
         for(int i=0; i < 10; i++)
            tags[i] = (i+"").charAt(0);
         for(int i=10; i < 36; i++)
            tags[i] = ap.charAt(i-10);
         ap = ap.toUpperCase();
         for(int i=36; i < 62; i++)
            tags[i] = ap.charAt(i-36);
         StringBuilder sb = new StringBuilder();
         while(T-- > 0)
         {
            st = new StringTokenizer(infile.readLine());
            int R = Integer.parseInt(st.nextToken());
            int C = Integer.parseInt(st.nextToken());
            int K = Integer.parseInt(st.nextToken());
            int[][] grid = new int[R][C];
            int total = 0;
            for(int r=0; r < R; r++)
            {
               String input = infile.readLine();
               for(int c=0; c < C; c++)
                  if(input.charAt(c) == 'R')
                  {
                     grid[r][c] = 1;
                     total++;
                  }
            }
            char[][] res = new char[R][C];
            int over = total%K;
            int id = 0;
            int cnt = 0;
            for(int r=0; r < R; r++)
            {
               if(r%2 == 0)
               {
                  for(int c=0; c < C; c++)
                  {
                     cnt += grid[r][c];
                     if(over > 0 && cnt > total/K+1)
                     {
                        cnt = 1;
                        id++;
                        over--;
                     }
                     else if(over == 0 && cnt > total/K)
                     {
                        cnt = 1;
                        id++;
                     }
                     res[r][c] = tags[id];
                  }
               }
               else
               {
                  for(int c=C-1; c >= 0; c--)
                  {
                     cnt += grid[r][c];
                     if(over > 0 && cnt > total/K+1)
                     {
                        cnt = 1;
                        id++;
                        over--;
                     }
                     else if(over == 0 && cnt > total/K)
                     {
                        cnt = 1;
                        id++;
                     }
                     res[r][c] = tags[id];
                  }
               }
            }
            for(int r=0; r < R; r++)
            {
               for(int c=0; c < C; c++)
                  sb.append(res[r][c]);
               sb.append("\n");
            }
         }
         System.out.print(sb);
      }
   }


import java.util.Scanner;

public class Main {

	public static void main(String[] args)
	{
		Scanner s=new Scanner(System.in);

		int t=s.nextInt();

		for(int i=0;i<t;i++)
		{
			int r=s.nextInt();
			int c=s.nextInt();
			int n=s.nextInt();

			char[][] arr=new char[r][c];

			int count=0;

			for(int j=0;j<r;j++)
			{
				String str=s.next();

				for(int k=0;k<c;k++)
				{
					arr[j][k]=str.charAt(k);

					if(arr[j][k]=='R')
					{
						count++;
					}
				}
			}

			int how=count/n;
			int count2=count%n;

			int curr=0;
			int done=0;

			int[][] ans=new int[r][c];

			int z=0;

			for(int j=0;j<r;j++)
			{

				if(j%2==0)
				{
					for(int k=0;k<c;k++)
					{
						if(done<count2)
						{
							ans[j][k]=curr;

							if(arr[j][k]=='R')
							{
								z++;
							}

							if(z==how+1)
							{
								done++;
								if(done<n)
								curr++;
								z=0;
							}

						}
						else
						{
							ans[j][k]=curr;

							if(arr[j][k]=='R')
							{
								z++;
							}

							if(z==how)
							{
								done++;
								if(done<n)
								curr++;
								z=0;
							}
						}
					}
				}
				else
				{
					for(int k=c-1;k>=0;k--)
					{
						if(done<count2)
						{
							ans[j][k]=curr;

							if(arr[j][k]=='R')
							{
								z++;
							}

							if(z==how+1)
							{
								done++;
								if(done<n)
								curr++;
								z=0;
							}

						}
						else
						{
							ans[j][k]=curr;

							if(arr[j][k]=='R')
							{
								z++;
							}

							if(z==how)
							{
								done++;
								if(done<n)
								curr++;
								z=0;
							}
						}
					}
				}
			}

			for(int j=0;j<r;j++)
			{
				for(int k=0;k<c;k++)
				{
					if(ans[j][k]>9&&ans[j][k]<36)
					{
						System.out.print((char)(55+ans[j][k]));
					}
					else if(ans[j][k]>35)
					{
						System.out.print((char)(61+ans[j][k]));
					}
					else
					{
						System.out.print(ans[j][k]);
					}
				}
				System.out.println();
			}

		}
	}

}


import java.util.Scanner;

public class Main {

	public static void main(String[] args)
	{
		Scanner s=new Scanner(System.in);

		int t=s.nextInt();

		for(int i=0;i<t;i++)
		{
			int r=s.nextInt();
			int c=s.nextInt();
			int n=s.nextInt();

			char[][] arr=new char[r][c];

			int count=0;

			for(int j=0;j<r;j++)
			{
				String str=s.next();

				for(int k=0;k<c;k++)
				{
					arr[j][k]=str.charAt(k);

					if(arr[j][k]=='R')
					{
						count++;
					}
				}
			}

			int how=count/n;
			int count2=count%n;

			int curr=0;
			int done=0;

			int[][] ans=new int[r][c];

			int z=0;

			for(int j=0;j<r;j++)
			{

				if(j%2==0)
				{
					for(int k=0;k<c;k++)
					{
						if(done<count2)
						{
							ans[j][k]=curr;

							if(arr[j][k]=='R')
							{
								z++;
							}

							if(z==how+1)
							{
								done++;
								curr++;
								z=0;
							}

						}
						else
						{
							ans[j][k]=curr;

							if(arr[j][k]=='R')
							{
								z++;
							}

							if(z==how)
							{
								done++;
								curr++;
								z=0;
							}
						}
					}
				}
				else
				{
					for(int k=c-1;k>=0;k--)
					{
						if(done<count2)
						{
							ans[j][k]=curr;

							if(arr[j][k]=='R')
							{
								z++;
							}

							if(z==how+1)
							{
								done++;
								if(done<n)
								curr++;
								z=0;
							}

						}
						else
						{
							ans[j][k]=curr;

							if(arr[j][k]=='R')
							{
								z++;
							}

							if(z==how)
							{
								done++;
								if(done<n)
								curr++;
								z=0;
							}
						}
					}
				}
			}

			for(int j=0;j<r;j++)
			{
				for(int k=0;k<c;k++)
				{
					if(ans[j][k]>9&&ans[j][k]<36)
					{
						System.out.print((char)(55+ans[j][k]));
					}
					else if(ans[j][k]>35)
					{
						System.out.print((char)(61+ans[j][k]));
					}
					else
					{
						System.out.print(ans[j][k]);
					}
				}
				System.out.println();
			}

		}
	}

}


import java.util.Scanner;

public class Main {

	public static void main(String[] args)
	{
		Scanner s=new Scanner(System.in);

		int t=s.nextInt();

		for(int i=0;i<t;i++)
		{
			int r=s.nextInt();
			int c=s.nextInt();
			int n=s.nextInt();

			char[][] arr=new char[r][c];

			int count=0;

			for(int j=0;j<r;j++)
			{
				String str=s.next();

				for(int k=0;k<c;k++)
				{
					arr[j][k]=str.charAt(k);

					if(arr[j][k]=='R')
					{
						count++;
					}
				}
			}

			int how=count/n;
			int count2=count%n;

			int curr=0;
			int done=0;

			int[][] ans=new int[r][c];

			int z=0;

			for(int j=0;j<r;j++)
			{

				if(j%2==0)
				{
					for(int k=0;k<c;k++)
					{
						if(done<count2)
						{
							ans[j][k]=curr;

							if(arr[j][k]=='R')
							{
								z++;
							}

							if(z==how+1)
							{
								done++;
								curr++;
								z=0;
							}

						}
						else
						{
							ans[j][k]=curr;

							if(arr[j][k]=='R')
							{
								z++;
							}

							if(z==how)
							{
								done++;
								curr++;
								z=0;
							}
						}
					}
				}
				else
				{
					for(int k=c-1;k>=0;k--)
					{
						if(done<count2)
						{
							ans[j][k]=curr;

							if(arr[j][k]=='R')
							{
								z++;
							}

							if(z==how+1&&done<n-1)
							{
								done++;
								curr++;
								z=0;
							}

						}
						else
						{
							ans[j][k]=curr;

							if(arr[j][k]=='R')
							{
								z++;
							}

							if(z==how&&done<n-1)
							{
								done++;
								curr++;
								z=0;
							}
						}
					}
				}
			}

			for(int j=0;j<r;j++)
			{
				for(int k=0;k<c;k++)
				{
					if(ans[j][k]>9&&ans[j][k]<36)
					{
						System.out.print((char)(55+ans[j][k]));
					}
					else if(ans[j][k]>35)
					{
						System.out.print((char)(61+ans[j][k]));
					}
					else
					{
						System.out.print(ans[j][k]);
					}
				}
				System.out.println();
			}

		}
	}

}


import java.util.Scanner;

public class Main {

	public static void main(String[] args)
	{
		Scanner s=new Scanner(System.in);

		int t=s.nextInt();

		for(int i=0;i<t;i++)
		{
			int r=s.nextInt();
			int c=s.nextInt();
			int n=s.nextInt();

			char[][] arr=new char[r][c];

			int count=0;

			for(int j=0;j<r;j++)
			{
				String str=s.next();

				for(int k=0;k<c;k++)
				{
					arr[j][k]=str.charAt(k);

					if(arr[j][k]=='R')
					{
						count++;
					}
				}
			}

			int how=count/n;
			int count2=count%n;

			int curr=0;
			int done=0;

			int[][] ans=new int[r][c];

			int z=0;

			for(int j=0;j<r;j++)
			{

				if(j%2==0)
				{
					for(int k=0;k<c;k++)
					{
						if(done<count2)
						{
							ans[j][k]=curr;

							if(arr[j][k]=='R')
							{
								z++;
							}

							if(z==how+1)
							{
								done++;
								curr++;
								z=0;
							}

						}
						else
						{
							ans[j][k]=curr;

							if(arr[j][k]=='R')
							{
								z++;
							}

							if(z==how)
							{
								done++;
								curr++;
								z=0;
							}
						}
					}
				}
				else
				{
					for(int k=c-1;k>=0;k--)
					{
						if(done<count2)
						{
							ans[j][k]=curr;

							if(arr[j][k]=='R')
							{
								z++;
							}

							if(z==how+1)
							{
								done++;
								curr++;
								z=0;
							}

						}
						else
						{
							ans[j][k]=curr;

							if(arr[j][k]=='R')
							{
								z++;
							}

							if(z==how)
							{
								done++;
								curr++;
								z=0;
							}
						}
					}
				}
			}

			for(int j=0;j<r;j++)
			{
				for(int k=0;k<c;k++)
				{
					if(ans[j][k]>9&&ans[j][k]<36)
					{
						System.out.print((char)(55+ans[j][k]));
					}
					else if(ans[j][k]>35)
					{
						System.out.print((char)(61+ans[j][k]));
					}
					else
					{
						System.out.print(ans[j][k]);
					}
				}
				System.out.println();
			}

		}
	}

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author KharYusuf
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DFeedingChicken solver = new DFeedingChicken();
        solver.solve(1, in, out);
        out.close();
    }

    static class DFeedingChicken {
        public void solve(int testNumber, FastReader s, PrintWriter w) {
            int tt = s.nextInt();
            while (tt-- > 0) {
                int r = s.nextInt(), c = s.nextInt(), k = s.nextInt(), tot = 0, cur = 0, ctot = 0, cc = 0;
                char[][] f = new char[r][c], ans = new char[r][c];
                for (int i = 0; i < r; i++)
                    for (int j = 0; j < c; j++) {
                        f[i][j] = s.nextChar();
                        if (f[i][j] == 'R') tot++;
                    }
                int rem = tot;
                tot /= k;
                int ex = rem - tot * k;
                //w.println(tot);
                char[] get = new char[62];
                for (int i = 0; i < 26; i++) get[i] = (char) ('a' + i);
                for (int i = 0; i < 26; i++) get[i + 26] = (char) ('A' + i);
                for (int i = 0; i < 10; i++) get[i + 52] = (char) ('0' + i);
                for (int i = 0; i < r; i++) {
                    int req = tot + (ex > 0 ? 1 : 0);
                    ex--;
                    //w.println(req);
                    if (cur == 0) {
                        for (int j = 0; j < c; j++) {
                            ans[i][j] = get[cc];
                            if (f[i][j] == 'R') {
                                ctot++;
                                if (ctot == req) {
                                    cc++;
                                    rem -= req;
                                    ctot = 0;
                                }
                            }
                        }
                    } else {
                        for (int j = c - 1; j >= 0; j--) {
                            ans[i][j] = get[cc];
                            if (f[i][j] == 'R') {
                                ctot++;
                                if (ctot == req) {
                                    cc++;
                                    rem -= req;
                                    ctot = 0;
                                }
                            }
                        }
                    }
                    cur ^= 1;
                }
                for (char[] a : ans) w.println(a);
            }
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {

            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {

                curChar = 0;

                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }

            return buf[curChar++];
        }

        public int nextInt() {

            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();

                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public char nextChar() {

            int c = read();

            while (isSpaceChar(c))
                c = read();

            return (char) c;
        }

        public boolean isSpaceChar(int c) {

            if (filter != null)
                return filter.isSpaceChar(c);

            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author KharYusuf
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DFeedingChicken solver = new DFeedingChicken();
        solver.solve(1, in, out);
        out.close();
    }

    static class DFeedingChicken {
        public void solve(int testNumber, FastReader s, PrintWriter w) {
            int tt = s.nextInt();
            while (tt-- > 0) {
                int r = s.nextInt(), c = s.nextInt(), k = s.nextInt(), tot = 0, cur = 0, ctot = 0, cc = 0;
                char[][] f = new char[r][c], ans = new char[r][c];
                for (int i = 0; i < r; i++)
                    for (int j = 0; j < c; j++) {
                        f[i][j] = s.nextChar();
                        if (f[i][j] == 'R') tot++;
                    }
                int rem = tot;
                tot /= k;
                //w.println(tot);
                char[] get = new char[62];
                for (int i = 0; i < 26; i++) get[i] = (char) ('a' + i);
                for (int i = 0; i < 26; i++) get[i + 26] = (char) ('A' + i);
                for (int i = 0; i < 10; i++) get[i + 52] = (char) ('0' + i);
                for (int i = 0; i < r; i++) {
                    int req = tot + (rem % tot == 0 ? 0 : 1);
                    //w.println(req);
                    if (cur == 0) {
                        for (int j = 0; j < c; j++) {
                            ans[i][j] = get[cc];
                            if (f[i][j] == 'R') {
                                ctot++;
                                if (ctot == req) {
                                    cc++;
                                    rem -= req;
                                    ctot = 0;
                                }
                            }
                        }
                    } else {
                        for (int j = c - 1; j >= 0; j--) {
                            ans[i][j] = get[cc];
                            if (f[i][j] == 'R') {
                                ctot++;
                                if (ctot == req) {
                                    cc++;
                                    rem -= req;
                                    ctot = 0;
                                }
                            }
                        }
                    }
                    cur ^= 1;
                }
                for (char[] a : ans) w.println(a);
            }
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {

            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {

                curChar = 0;

                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }

            return buf[curChar++];
        }

        public int nextInt() {

            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();

                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public char nextChar() {

            int c = read();

            while (isSpaceChar(c))
                c = read();

            return (char) c;
        }

        public boolean isSpaceChar(int c) {

            if (filter != null)
                return filter.isSpaceChar(c);

            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author KharYusuf
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DFeedingChicken solver = new DFeedingChicken();
        solver.solve(1, in, out);
        out.close();
    }

    static class DFeedingChicken {
        public void solve(int testNumber, FastReader s, PrintWriter w) {
            int tt = s.nextInt();
            while (tt-- > 0) {
                int r = s.nextInt(), c = s.nextInt(), k = s.nextInt(), tot = 0, cur = 0, ctot = 0, cc = 0;
                char[][] f = new char[r][c], ans = new char[r][c];
                for (int i = 0; i < r; i++)
                    for (int j = 0; j < c; j++) {
                        f[i][j] = s.nextChar();
                        if (f[i][j] == 'R') tot++;
                    }
                int rem = tot / k;
                tot /= k;
                char[] get = new char[62];
                for (int i = 0; i < 26; i++) get[i] = (char) ('a' + i);
                for (int i = 0; i < 26; i++) get[i + 26] = (char) ('A' + i);
                for (int i = 0; i < 10; i++) get[i + 52] = (char) ('0' + i);
                for (int i = 0; i < r; i++) {
                    int req = tot + rem % tot == 0 ? 0 : 1;
                    if (cur == 0) {
                        for (int j = 0; j < c; j++) {
                            ans[i][j] = get[cc];
                            if (f[i][j] == 'R') {
                                ctot++;
                                if (ctot == req) {
                                    cc++;
                                    ctot = 0;
                                }
                            }
                        }
                    } else {
                        for (int j = c - 1; j >= 0; j--) {
                            ans[i][j] = get[cc];
                            if (f[i][j] == 'R') {
                                ctot++;
                                if (ctot == req) {
                                    cc++;
                                    ctot = 0;
                                }
                            }
                        }
                    }
                    cur ^= 1;
                }
                for (char[] a : ans) w.println(a);
            }
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {

            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {

                curChar = 0;

                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }

            return buf[curChar++];
        }

        public int nextInt() {

            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();

                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public char nextChar() {

            int c = read();

            while (isSpaceChar(c))
                c = read();

            return (char) c;
        }

        public boolean isSpaceChar(int c) {

            if (filter != null)
                return filter.isSpaceChar(c);

            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author KharYusuf
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DFeedingChicken solver = new DFeedingChicken();
        solver.solve(1, in, out);
        out.close();
    }

    static class DFeedingChicken {
        public void solve(int testNumber, FastReader s, PrintWriter w) {
            int tt = s.nextInt();
            while (tt-- > 0) {
                int r = s.nextInt(), c = s.nextInt(), k = s.nextInt(), tot = 0, cur = 0, ctot = 0, cc = 0;
                char[][] f = new char[r][c], ans = new char[r][c];
                for (int i = 0; i < r; i++)
                    for (int j = 0; j < c; j++) {
                        f[i][j] = s.nextChar();
                        if (f[i][j] == 'R') tot++;
                    }
                int rem = tot;
                tot /= k;
                int ex = rem - tot * k;
                //w.println(tot);
                char[] get = new char[62];
                for (int i = 0; i < 26; i++) get[i] = (char) ('a' + i);
                for (int i = 0; i < 26; i++) get[i + 26] = (char) ('A' + i);
                for (int i = 0; i < 10; i++) get[i + 52] = (char) ('0' + i);
                int req = tot + (ex > 0 ? 1 : 0);
                ex--;
                for (int i = 0; i < r; i++) {
                    if (cur == 0) {
                        for (int j = 0; j < c; j++) {
                            //w.println(i+" "+j+" "+ctot);
                            if (f[i][j] == 'R') {
                                if (ctot == req) {
                                    cc++;
                                    rem -= req;
                                    req = tot + (ex > 0 ? 1 : 0);
                                    ex--;
                                    ctot = 0;
                                }
                                ctot++;
                            }
                            ans[i][j] = get[cc];
                        }
                    } else {
                        for (int j = c - 1; j >= 0; j--) {
                            //w.println(i+" "+j+" "+ctot);
                            if (f[i][j] == 'R') {
                                if (ctot == req) {
                                    cc++;
                                    rem -= req;
                                    req = tot + (ex > 0 ? 1 : 0);
                                    ex--;
                                    ctot = 0;
                                }
                                ctot++;
                            }
                            ans[i][j] = get[cc];
                        }
                    }
                    cur ^= 1;
                }
                for (char[] a : ans) w.println(a);
            }
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {

            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {

                curChar = 0;

                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }

            return buf[curChar++];
        }

        public int nextInt() {

            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();

                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public char nextChar() {

            int c = read();

            while (isSpaceChar(c))
                c = read();

            return (char) c;
        }

        public boolean isSpaceChar(int c) {

            if (filter != null)
                return filter.isSpaceChar(c);

            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author KharYusuf
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DFeedingChicken solver = new DFeedingChicken();
        solver.solve(1, in, out);
        out.close();
    }

    static class DFeedingChicken {
        public void solve(int testNumber, FastReader s, PrintWriter w) {
            int tt = s.nextInt();
            while (tt-- > 0) {
                int r = s.nextInt(), c = s.nextInt(), k = s.nextInt(), tot = 0, cur = 0, ctot = 0, cc = 0;
                char[][] f = new char[r][c], ans = new char[r][c];
                for (int i = 0; i < r; i++)
                    for (int j = 0; j < c; j++) {
                        f[i][j] = s.nextChar();
                        if (f[i][j] == 'R') tot++;
                    }
                int rem = tot / k;
                tot /= k;
                char[] get = new char[62];
                for (int i = 0; i < 26; i++) get[i] = (char) ('a' + i);
                for (int i = 0; i < 26; i++) get[i + 26] = (char) ('A' + i);
                for (int i = 0; i < 10; i++) get[i + 52] = (char) ('0' + i);
                for (int i = 0; i < r; i++) {
                    int req = tot + rem % tot == 0 ? 0 : 1;
                    if (cur == 0) {
                        for (int j = 0; j < c; j++) {
                            ans[i][j] = get[cc];
                            if (f[i][j] == 'R') {
                                ctot++;
                                if (ctot == req) {
                                    cc++;
                                    rem -= req;
                                    ctot = 0;
                                }
                            }
                        }
                    } else {
                        for (int j = c - 1; j >= 0; j--) {
                            ans[i][j] = get[cc];
                            if (f[i][j] == 'R') {
                                ctot++;
                                if (ctot == req) {
                                    cc++;
                                    rem -= req;
                                    ctot = 0;
                                }
                            }
                        }
                    }
                    cur ^= 1;
                }
                for (char[] a : ans) w.println(a);
            }
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {

            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {

                curChar = 0;

                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }

            return buf[curChar++];
        }

        public int nextInt() {

            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();

                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public char nextChar() {

            int c = read();

            while (isSpaceChar(c))
                c = read();

            return (char) c;
        }

        public boolean isSpaceChar(int c) {

            if (filter != null)
                return filter.isSpaceChar(c);

            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author KharYusuf
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DFeedingChicken solver = new DFeedingChicken();
        solver.solve(1, in, out);
        out.close();
    }

    static class DFeedingChicken {
        public void solve(int testNumber, FastReader s, PrintWriter w) {
            int tt = s.nextInt();
            while (tt-- > 0) {
                int r = s.nextInt(), c = s.nextInt(), k = s.nextInt(), tot = 0, cur = 0, ctot = 0, cc = 0;
                char[][] f = new char[r][c], ans = new char[r][c];
                for (int i = 0; i < r; i++)
                    for (int j = 0; j < c; j++) {
                        f[i][j] = s.nextChar();
                        if (f[i][j] == 'R') tot++;
                    }
                int rem = tot;
                tot /= k;
                int ex = rem - tot * k;
                //w.println(tot);
                char[] get = new char[62];
                for (int i = 0; i < 26; i++) get[i] = (char) ('a' + i);
                for (int i = 0; i < 26; i++) get[i + 26] = (char) ('A' + i);
                for (int i = 0; i < 10; i++) get[i + 52] = (char) ('0' + i);
                for (int i = 0; i < r; i++) {
                    int req = tot + (ex > 0 ? 1 : 0);
                    ex--;
                    //w.println(req);
                    if (cur == 0) {
                        for (int j = 0; j < c; j++) {
                            if (f[i][j] == 'R') {
                                if (ctot == req) {
                                    cc++;
                                    rem -= req;
                                    ctot = 0;
                                }
                                ctot++;
                            }
                            ans[i][j] = get[cc];
                        }
                    } else {
                        for (int j = c - 1; j >= 0; j--) {
                            if (f[i][j] == 'R') {
                                if (ctot == req) {
                                    cc++;
                                    rem -= req;
                                    ctot = 0;
                                }
                                ctot++;
                            }
                            ans[i][j] = get[cc];
                        }
                    }
                    cur ^= 1;
                }
                for (char[] a : ans) w.println(a);
            }
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {

            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {

                curChar = 0;

                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }

            return buf[curChar++];
        }

        public int nextInt() {

            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();

                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public char nextChar() {

            int c = read();

            while (isSpaceChar(c))
                c = read();

            return (char) c;
        }

        public boolean isSpaceChar(int c) {

            if (filter != null)
                return filter.isSpaceChar(c);

            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}