#include <bits/stdc++.h>
using namespace std;
const long long MOD = 119 << 23 | 1;
long long gcd(long long x, long long y) {
  if (!y) return x;
  return gcd(y, x % y);
}
long long inv(long long x) {
  long long r = 1ll, t = x, k = MOD - 2ll;
  while (k) {
    if (k & 1ll) r = (long long)r * t % MOD;
    t = (long long)t * t % MOD;
    k >>= 1;
  }
  return r;
}
vector<string> Grid;
int r, c, k;
string alphabet =
    "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890";
void readIN() {
  cin >> r >> c >> k;
  Grid = vector<string>(r, "");
  for (int i = 0; i < r; i++) cin >> Grid[i];
}
void solve() {
  int ile = 0;
  for (auto str : Grid)
    for (auto cha : str)
      if (cha == 'R') ile++;
  int update = 1, ktory = 0, il = 0;
  for (int i = 0; i < r; i++) {
    for (int j = (update > 0 ? 0 : c - 1); j >= 0 && j < c; j += update) {
      char tmp = Grid[i][j];
      Grid[i][j] = alphabet[min(ktory, k - 1)];
      if (tmp == 'R') {
        il++;
        if (ktory < ile % k && il == ile / k + 1) {
          il = 0;
          ktory++;
        } else if (ktory >= ile % k && il == ile / k) {
          il = 0;
          ktory++;
        }
      }
    }
    update = -update;
  }
  for (auto el : Grid) cout << el << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  int t;
  cin >> t;
  while (t--) {
    readIN();
    solve();
  }
  return 0;
}
