#include <bits/stdc++.h>
using namespace std;
char cs[110];
int main() {
  int T;
  scanf("%d", &T);
  vector<char> x;
  for (char t = 'a'; t <= 'z'; t++) x.push_back(t);
  for (char t = 'A'; t <= 'Z'; t++) x.push_back(t);
  for (char t = '0'; t <= '9'; t++) x.push_back(t);
  while (T--) {
    int r, c, k;
    scanf("%d%d%d", &r, &c, &k);
    vector<string> M(r), ans(r, string(c, '.'));
    int cnt = 0;
    for (auto& t : M) {
      scanf("%s", cs);
      t = cs;
      cnt += count(begin(t), end(t), 'R');
    }
    int tr = 0, tc = 0;
    bool dir = false;
    auto paint = [&](int id) {
      ans[tr][tc] = x[id];
      if (dir)
        tc--;
      else
        tc++;
      if (tc < 0) tc = 0, tr++, dir = !dir;
      if (tc == c) tc = c - 1, tr++, dir = !dir;
    };
    for (int i = 0; i < k; i++) {
      int des = cnt / k + (i < cnt % k);
      while (des) {
        if (M[tr][tc] == 'R') des--;
        paint(i);
      }
      if (i == k - 1) {
        while (tr < r) paint(i);
      }
    }
    for (const auto& t : ans) puts(t.c_str());
  }
}
