#include <bits/stdc++.h>
int main() {
  int t;
  scanf("%d", &t);
  int i, j, l;
  int r, c;
  int k;
  char s[102][102];
  int ans[102][102];
  char z[100];
  for (i = 0; i <= 'z' - 'a'; i++) z[i] = 'a' + i;
  for (i = 0; i <= 'z' - 'a'; i++) z[i + 'z' - 'a' + 1] = 'A' + i;
  for (i = 0; i < 10; i++) z[i + 2 * ('z' - 'a' + 1)] = '0' + i;
  int sum, count, now;
  for (l = 0; l < t; l++) {
    scanf("%d %d %d", &r, &c, &k);
    for (i = 0; i < r; i++) scanf("%s", s[i]);
    sum = 0;
    for (i = 0; i < r; i++)
      for (j = 0; j < c; j++)
        if (s[i][j] == 'R') sum++;
    i = j = 0;
    count = sum / k;
    now = 0;
    for (i = 0; i < r; i++) {
      if (i % 2 == 0) {
        for (j = 0; j < c; j++) {
          if (s[i][j] == '.')
            ans[i][j] = now;
          else {
            if (count > 0) {
              ans[i][j] = now;
              count--;
              sum--;
            } else {
              now++;
              k--;
              count = sum / k;
              ans[i][j] = now;
              sum--;
              count--;
            }
          }
        }
      } else {
        for (j = c - 1; j >= 0; j--) {
          if (s[i][j] == '.')
            ans[i][j] = now;
          else {
            if (count > 0) {
              ans[i][j] = now;
              count--;
              sum--;
            } else {
              now++;
              k--;
              count = sum / k;
              ans[i][j] = now;
              sum--;
              count--;
            }
          }
        }
      }
    }
    for (i = 0; i < r; i++) {
      for (j = 0; j < c; j++) printf("%c", z[ans[i][j]]);
      printf("\n");
    }
  }
  return 0;
}
