#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long base = 1e9 + 7;
const long long oo = 106 + 10;
const long long gh = 1e3 + 3;
const long long inf = 1e15 + 5;
long long n, m, k, q;
char a[oo][oo];
char T[oo];
long long cur = 0;
void input() {
  cin >> n >> m >> k;
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++) cin >> a[i][j];
}
void cre() {
  for (char i = 'a'; i <= 'z'; i++) T[++cur] = i;
  for (char i = 'A'; i <= 'Z'; i++) T[++cur] = i;
  for (char i = '0'; i <= '9'; i++) T[++cur] = i;
}
char ans[oo][oo];
void solve() {
  long long d = 0;
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++)
      if (a[i][j] == 'R') d++;
  long long t = d / k;
  long long q = d % k;
  long long cur = 1;
  d = 0;
  for (long long i = 1; i <= n; i++) {
    if (i % 2)
      for (long long j = 1; j <= m; j++) {
        ans[i][j] = T[cur];
        if (a[i][j] == 'R') d++;
        if (d == t + (q > 0)) cur++, q--, d = 0, k--;
        if (k == 0) k--, cur--;
      }
    else {
      for (long long j = m; j; j--) {
        ans[i][j] = T[cur];
        if (a[i][j] == 'R') d++;
        if (d == t + (q > 0)) cur++, q--, d = 0, k--;
        if (k == 0) k--, cur--;
      }
    }
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) cout << ans[i][j];
    cout << '\n';
  }
}
void ouput() {}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  if (ifstream("test.txt")) {
    freopen("test.txt", "r", stdin);
  } else if (ifstream(""
                      ".inp")) {
    freopen(
        ""
        ".inp",
        "r", stdin);
    freopen(
        ""
        ".out",
        "w", stdout);
  }
  long long t = 1;
  cin >> t;
  cre();
  while (t--) {
    input();
    solve();
    ouput();
  }
}
