#include <bits/stdc++.h>
using namespace std;
char g[105][105];
vector<char> c;
int main() {
  int n, m, k, T;
  scanf("%d", &T);
  for (char i = 'a'; i <= 'z'; i++) c.push_back(i);
  for (char i = 'A'; i <= 'Z'; i++) c.push_back(i);
  for (char i = '0'; i <= '9'; i++) c.push_back(i);
  while (T--) {
    scanf("%d%d%d", &n, &m, &k);
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      scanf(" %s", g[i]);
      for (int j = 0; j < m; j++) cnt += g[i][j] == 'R';
    }
    assert(k <= cnt);
    int val = cnt / k;
    int more = cnt % k;
    int cur = 0;
    int idx = 0;
    for (int i = 0; i < n; i++) {
      int st = 0, ed = m, ic = 1;
      if (i % 2) {
        st = m - 1;
        ed = -1;
        ic = -1;
      }
      for (int j = st; j != ed; j += ic) {
        if (g[i][j] == 'R') cur++;
        g[i][j] = c[idx];
        int qtt = val + (more > 0);
        if (cur == qtt and idx != k - 1) {
          idx++;
          more--;
          cur = 0;
        }
      }
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) printf("%c", g[i][j]);
      printf("\n");
    }
  }
  return 0;
}
