#include <bits/stdc++.h>
using namespace std;
template <class t>
inline t read(t &x) {
  char c = getchar();
  bool f = 0;
  x = 0;
  while (!isdigit(c)) f |= c == '-', c = getchar();
  while (isdigit(c)) x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
  if (f) x = -x;
  return x;
}
template <class t>
inline void write(t x) {
  if (x < 0)
    putchar('-'), write(-x);
  else {
    if (x > 9) write(x / 10);
    putchar('0' + x % 10);
  }
}
const char name[] =
    " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
const int N = 105;
int n, m, c, a[N][N], need[N];
char s[N][N];
void doit() {
  int n, m, c, r = 0;
  read(n);
  read(m);
  read(c);
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (s[i][j] == 'R') r++;
  for (int i = 1; i <= r; i++) need[i] = r / c + (i <= r % c);
  for (int i = 1, k = 1; i <= n; i++) {
    if (i & 1) {
      for (int j = 1; j <= m; j++) {
        a[i][j] = k;
        if (s[i][j] == 'R') need[k]--;
        if (!need[k] && k < c) k++;
      }
    } else {
      for (int j = m; j >= 1; j--) {
        a[i][j] = k;
        if (s[i][j] == 'R') need[k]--;
        if (!need[k] && k < c) k++;
      }
    }
  }
  for (int i = 1; i <= n; i++, puts(""))
    for (int j = 1; j <= m; j++) putchar(name[a[i][j]]);
}
signed main() {
  int t;
  read(t);
  while (t--) doit();
}
