#include <bits/stdc++.h>
using namespace std;
char a[111][111];
int r, c;
int k, z;
int eat;
void col(int x, int y) {
  int cc = (eat * k / z);
  if (cc == k) cc--;
  if (cc < 26) {
    cc += 'a';
  } else if (cc < 52) {
    cc += 'A' - 26;
  } else {
    cc += '0' - 52;
  }
  if (a[x][y] == 'R') {
    eat++;
  }
  a[x][y] = cc;
}
int main() {
  int t;
  scanf("%i", &t);
  while (t--) {
    scanf("%i%i%i", &r, &c, &k);
    for (int i = 0; i < r; i++) {
      scanf("%s", a[i]);
    }
    z = 0;
    for (int i = 0; i < r; i++) {
      for (int j = 0; j < c; j++) {
        if (a[i][j] == 'R') z++;
      }
    }
    int x = 0, y = 0;
    int cc = 0;
    int dir = 0;
    eat = 0;
    while (x < r) {
      col(x, y);
      if (!dir) {
        y++;
        if (y == c) {
          y = c - 1;
          x++;
          dir = 1;
        }
      } else {
        y--;
        if (y == -1) {
          y = 0;
          x++;
          dir = 0;
        }
      }
    }
    for (int i = 0; i < r; i++) {
      printf("%s\n", a[i]);
    }
  }
}
