#include <bits/stdc++.h>
using namespace std;
int T, n, m, k;
int num[110];
char key[110];
char g[110][110];
char ans[110][110];
void solve() {
  memset(num, 0, sizeof(num));
  memset(ans, 0, sizeof(ans));
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) scanf("%s", *(g + i) + 1);
  int sum = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (g[i][j] == 'R') sum++;
  int ave = sum / k, more = sum % k;
  for (int i = 1, pt = 1; i <= n; i++) {
    if (i % 2 == 1)
      for (int j = 1; j <= m; j++) {
        if (g[i][j] == 'R' &&
            (pt <= more && num[pt] == ave + 1 || pt > more && num[pt] == ave))
          pt++;
        ans[i][j] = key[pt];
        if (g[i][j] == 'R') num[pt]++;
      }
    else
      for (int j = m; j >= 1; j--) {
        if (g[i][j] == 'R' &&
            (pt <= more && num[pt] == ave + 1 || pt > more && num[pt] == ave))
          pt++;
        ans[i][j] = key[pt];
        if (g[i][j] == 'R') num[pt]++;
      }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) printf("%c", ans[i][j]);
    printf("\n");
  }
}
int main() {
  for (int i = 1; i <= 26; i++) key[i] = 'a' + i - 1;
  for (int i = 27; i <= 52; i++) key[i] = 'A' + i - 27;
  for (int i = 53; i <= 62; i++) key[i] = '0' + i - 53;
  scanf("%d", &T);
  while (T--) solve();
  return 0;
}
