#include <bits/stdc++.h>
using namespace std;
char ch[63];
char A[101][101];
int cnt[63];
int main() {
  ch[0] = 'a';
  for (int i = 0; i < 26; i++) ch[i + 1] = 'a' + i;
  for (int i = 26; i < 52; i++) ch[i + 1] = 'A' + i - 26;
  for (int i = 52; i < 62; i++) ch[i + 1] = '0' + i - 52;
  int T;
  scanf("%d", &T);
  while (T--) {
    int n, m, k;
    scanf("%d%d%d", &n, &m, &k);
    for (int i = 0; i < n; i++) scanf("%s", A[i]);
    int S = 0;
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) S += A[i][j] == 'R';
    for (int i = 1; i <= k; i++) {
      cnt[i] = S / (k + 1 - i);
      S -= cnt[i];
    }
    for (int i = 0; i < n; i++) {
      if (i & 1)
        for (int j = m - 1; j >= 0; j--) {
          if (A[i][j] == '.')
            A[i][j] = ch[k];
          else {
            A[i][j] = ch[k];
            if (--cnt[k] == 0) k--;
          }
        }
      else
        for (int j = 0; j < m; j++) {
          if (A[i][j] == '.')
            A[i][j] = ch[k];
          else {
            A[i][j] = ch[k];
            if (--cnt[k] == 0) k--;
          }
        }
    }
    for (int i = 0; i < n; i++) puts(A[i]);
  }
  return 0;
}
