#include <bits/stdc++.h>
using namespace std;
const int N = 110;
char a[N][N], ans[N][N];
char ch[N];
int r, c, k, m;
void solve() {
  cin >> r >> c >> k;
  int cnt = 0;
  for (int i = 0; i < r; ++i) {
    getchar();
    for (int j = 0; j < c; ++j) {
      a[i][j] = getchar();
      if (a[i][j] == 'R') cnt++;
    }
  }
  int cur = 0;
  for (int i = 0; i < r; ++i) {
    for (int j = 0; j < c; ++j) {
      int t = j;
      if (i % 2 == 1) t = c - j - 1;
      ans[i][t] = ch[k];
      cur += (a[i][t] == 'R');
      if (k > 1 && cur == cnt / k) {
        cnt -= cur;
        cur = 0;
        --k;
      }
    }
  }
  for (int i = 0; i < r; ++i) {
    for (int j = 0; j < c; ++j) {
      putchar(ans[i][j]);
    }
    putchar('\n');
  }
}
void init() {
  m = 0;
  for (char c = 'a'; c <= 'z'; ++c) ch[++m] = c;
  for (char c = 'A'; c <= 'Z'; ++c) ch[++m] = c;
  for (char c = '0'; c <= '9'; ++c) ch[++m] = c;
}
int main() {
  init();
  int nT;
  cin >> nT;
  while (nT--) solve();
}
