#include <bits/stdc++.h>
using namespace std;
const int maxn = 207;
char a[maxn][maxn], ans[maxn][maxn], c[maxn];
int p[maxn];
int n, m, k;
void init() {
  int cnt = 0;
  for (int i = 0; i <= 9; i++) c[++cnt] = i + '0';
  for (int i = 0; i <= 25; i++) c[++cnt] = i + 'A';
  for (int i = 0; i <= 25; i++) c[++cnt] = i + 'a';
}
void rua() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) scanf("%s", a[i] + 1);
  int num = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (a[i][j] == 'R') num++;
  for (int i = 1; i <= k; i++) p[i] = num / k;
  for (int i = 1; i <= num % k; i++) p[i]++;
  int res = 1;
  p[k] = (int)1e9;
  for (int i = 1; i <= n; i++) {
    if (i % 2 == 0)
      for (int j = m; j > 0; j--) {
        if (a[i][j] == 'R') p[res]--;
        ans[i][j] = c[res];
        if (p[res] == 0) res++;
      }
    else
      for (int j = 1; j <= m; j++) {
        if (a[i][j] == 'R') p[res]--;
        ans[i][j] = c[res];
        if (p[res] == 0) res++;
      }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) cout << ans[i][j];
    printf("\n");
  }
}
int main() {
  init();
  int t;
  scanf("%d", &t);
  while (t--) rua();
  return 0;
}
