#include <bits/stdc++.h>
using namespace std;
template <class T>
bool mini(T &a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool maxi(T &a, T b) {
  return a < b ? (a = b, true) : false;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(10);
  cout << fixed;
  int test;
  cin >> test;
  while (test--) {
    int n, m, k;
    cin >> n >> m >> k;
    int ttl = 0;
    vector<vector<bool>> a(n, vector<bool>(m));
    for (int i = 0; i < (int)(n); i++)
      for (int j = 0; j < (int)(m); j++) {
        char c;
        cin >> c;
        a[i][j] = c == 'R';
        ttl += a[i][j];
      }
    vector<int> vals;
    int tar = ttl / k;
    for (int i = 0; i < (int)(ttl % k); i++) vals.push_back(tar + 1);
    for (int i = 0; i < (int)(k - (ttl % k)); i++) vals.push_back(tar);
    vector<vector<char>> ans(n, vector<char>(m));
    vector<char> lab;
    for (int i = (int)('a'); i <= (int)('z'); i++) lab.push_back(i);
    for (int i = (int)('A'); i <= (int)('Z'); i++) lab.push_back(i);
    for (int i = (int)('0'); i <= (int)('9'); i++) lab.push_back(i);
    for (int i = 0; i < (int)(n); i++) {
      for (int t = 0; t < (int)(m); t++) {
        int j = i & 1 ? m - 1 - t : t;
        ans[i][j] = lab.back();
        if (vals.size()) {
          vals.back() -= a[i][j];
          if (vals.back() == 0) {
            if (vals.size() > 1) lab.pop_back();
            vals.pop_back();
          }
        }
      }
    }
    for (int i = 0; i < (int)(n); i++) {
      for (int j = 0; j < (int)(m); j++) cout << ans[i][j];
      cout << "\n";
    }
  }
}
