#include <bits/stdc++.h>
using namespace std;
const int N = 103;
using pi = pair<int, int>;
inline int rd() {
  int x = 0, f = 1, c;
  while (!isdigit(c = getchar()))
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return f * x;
}
int n, m, k;
char p[N][N];
inline void solve() {
  n = rd(), m = rd(), k = rd();
  int cntr = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> p[i][j], cntr += p[i][j] == 'R';
  vector<int> sz;
  for (int i = 1; i <= cntr - cntr / k * k; i++) sz.push_back(cntr / k + 1);
  while (sz.size() < k) sz.push_back(cntr / k);
  vector<char> ch;
  for (int i = 0; i < 26; i++) ch.push_back('A' + i), ch.push_back('a' + i);
  for (char i = '0'; i <= '9'; i++) ch.push_back(i);
  for (int r = 1, cr = 0; r <= n; r++) {
    if (r & 1)
      for (int c = 1; c <= m; c++) {
        if (p[r][c] == 'R') cr++;
        p[r][c] = ch.back();
        if (cr == sz.back()) {
          sz.pop_back();
          cr = 0;
          if (sz.size()) ch.pop_back();
        }
      }
    else
      for (int c = m; c; c--) {
        if (p[r][c] == 'R') cr++;
        p[r][c] = ch.back();
        if (cr == sz.back()) {
          sz.pop_back();
          cr = 0;
          if (sz.size()) ch.pop_back();
        }
      }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) cout << p[i][j];
    cout << endl;
  }
}
int main() {
  for (int T = rd(); T--; solve())
    ;
}
