#include <bits/stdc++.h>
using namespace std;
string SYMBOLS =
    "QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890";
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t, i, x, j, y, z, k, n;
  long long tt;
  cin >> tt;
  for (long long _tt = 0; _tt < tt; _tt++) {
    long long r, c, k, ri = 0;
    cin >> r >> c >> k;
    string s[r];
    char res[r][c];
    for (i = 0; i < r; i += 1) cin >> s[i];
    for (i = 0; i < r; i += 1)
      for (j = 0; j < c; j += 1)
        if (s[i][j] == 'R') ri++;
    std::vector<pair<long long, long long> > v;
    for (i = 0; i < r; i += 1) {
      if (i & 1) {
        for (j = c - 1; j >= 0; j--) v.push_back({i, j});
      } else {
        for (j = 0; j < c; j++) v.push_back({i, j});
      }
    }
    long long av = ri / k, to = ri % k;
    i = 0;
    j = 0;
    while (to) {
      z = av + 1;
      while (i < v.size() && z > 0) {
        x = v[i].first, y = v[i].second;
        res[x][y] = SYMBOLS[j];
        if (s[x][y] == 'R') z--, ri--;
        i++;
      }
      to--;
      if (ri) j++;
    }
    while (i < v.size()) {
      z = av;
      while (i < v.size() && z > 0) {
        x = v[i].first, y = v[i].second;
        res[x][y] = SYMBOLS[j];
        if (s[x][y] == 'R') z--, ri--;
        i++;
      }
      to--;
      if (ri) j++;
    }
    for (i = 0; i < r; i += 1) {
      for (j = 0; j < c; j += 1) cout << res[i][j];
      cout << "" << '\n';
    }
  }
}
