#include <bits/stdc++.h>
using namespace std;
int Set(int N, int pos) { return N = N | (1 << pos); }
int reset(int N, int pos) { return N = N & ~(1 << pos); }
bool check(int N, int pos) { return (bool)(N & (1 << pos)); }
inline int addmod(int x, int y) {
  return (x % 1000000007 + y % 1000000007) % 1000000007;
}
inline int submod(int x, int y) {
  return (x % 1000000007 - y % 1000000007 + 1000000007) % 1000000007;
}
inline int mulmod(int x, int y) {
  return (x % 1000000007 * 1LL * y % 1000000007) % 1000000007;
}
inline int nextSubMask(int i, int mask) { return (i - 1) & mask; }
template <typename T>
void we_r_done(T mssg) {
  cout << mssg;
  exit(0);
}
vector<char> chick;
string s[102];
int n, m, c;
int row, col;
bool vis[111][111];
void fixrc(int i, int j) {
  row = i;
  col = j;
}
char who;
void fun(int i, int j, int baki) {
  if (s[i][j] == 'R' && baki == 0) {
    fixrc(i, j);
    return;
  }
  baki -= (s[i][j] == 'R');
  s[i][j] = who;
  vis[i][j] = true;
  if (j && vis[i][j - 1] == false) {
    fun(i, j - 1, baki);
  } else if ((j + 1) < m && vis[i][j + 1] == false) {
    fun(i, j + 1, baki);
  } else if (i)
    fun(i - 1, j, baki);
}
int main() {
  for (char i = '0'; i <= '9'; i++) chick.push_back(i);
  for (char i = 'A'; i <= 'Z'; i++) chick.push_back(i);
  for (char i = 'a'; i <= 'z'; i++) chick.push_back(i);
  int t;
  cin >> t;
  while (t--) {
    cin >> n >> m >> c;
    int tot = 0;
    for (int i = 0; i < n; i++) {
      cin >> s[i];
      for (int j = 0; j < m; j++) {
        tot += (s[i][j] == 'R');
        vis[i][j] = false;
      }
    }
    row = n - 1;
    col = m - 1;
    char last;
    for (int i = 0; i < c; i++) {
      who = chick[i];
      int cc = c - i;
      cc = tot / cc + (tot % cc != 0);
      tot -= cc;
      fun(row, col, cc);
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        cout << s[i][j];
      }
      cout << endl;
    }
  }
  return 0;
}
