#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
long long int INF64 = mod * mod + 1;
void solve() {
  long long int r, c, k;
  cin >> r >> c >> k;
  long long int rice = 0;
  vector<string> farm(r);
  for (long long int i = 0; i < r; i++) cin >> farm[i];
  for (auto it : farm) {
    for (auto itr : it) {
      if (itr == 'R') rice++;
    }
  }
  vector<vector<char>> ans(r, vector<char>(c));
  vector<char> name(62);
  for (long long int i = 0; i < 26; i++) name[i] = i + 'a';
  for (long long int i = 26; i < 52; i++) name[i] = i + 'A' - 26;
  for (long long int i = 52; i < 62; i++) name[i] = i - 52 + '0';
  long long int x = rice % k, y = rice / k, curr = y + (bool)(x), pos = 0;
  if (x) x--;
  long long int cells = r * c, t = k;
  for (long long int i = 0; i < r; i++) {
    if (i % 2) {
      for (long long int j = c - 1; j >= 0; j--) {
        ans[i][j] = name[pos];
        cells--;
        if (farm[i][j] == 'R') curr--;
        if (curr == 0 || cells == k - 1) {
          k--;
          curr = y + (bool)(x);
          if (x) x--;
          pos = min(pos + 1, t - 1);
        }
      }
    } else {
      for (long long int j = 0; j < c; j++) {
        ans[i][j] = name[pos];
        cells--;
        if (farm[i][j] == 'R') curr--;
        if (curr == 0 || cells == k - 1) {
          k--;
          curr = y + (bool)(x);
          if (x) x--;
          pos = min(pos + 1, t - 1);
        }
      }
    }
  }
  for (auto it : ans) {
    for (auto itr : it) cout << itr;
    cout << '\n';
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int T = 1;
  cin >> T;
  for (long long int i = 1; i <= T; i++) {
    solve();
  }
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
}
