#include <bits/stdc++.h>
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
void soln();
signed main() {
  int t = 1;
  {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
  };
  cin >> t;
  while (t--) soln();
  return 0;
}
void soln() {
  char f[110][110];
  int ans[110][110];
  int r, c, k;
  cin >> r >> c >> k;
  int rice = 0;
  for (int i = 0; i < r; ++i) {
    for (int j = 0; j < c; ++j) {
      cin >> f[i][j];
      if (f[i][j] == 'R') ++rice;
    }
  }
  int per = rice / k, ex = rice % k, id = 0;
  int req = 0;
  for (int i = 0; i < r; ++i) {
    if (i & 1) {
      for (int j = c - 1; j >= 0; --j) {
        if (!req) {
          req = per + (ex-- > 0);
          if (id < k) id++;
        }
        if (f[i][j] == 'R') {
          req--;
        }
        ans[i][j] = id;
      }
    } else {
      for (int j = 0; j < c; ++j) {
        if (!req) {
          req = per + (ex-- > 0);
          if (id < k) id++;
        }
        if (f[i][j] == 'R') {
          req--;
        }
        ans[i][j] = id;
      }
    }
  }
  map<int, char> mt;
  for (int i = 1; i <= 26; ++i) {
    mt[i] = 'a' + (i - 1);
  }
  for (int i = 27; i <= 52; ++i) {
    mt[i] = 'A' + (i - 27);
  }
  for (int i = 53; i <= 62; ++i) {
    mt[i] = '0' + (i - 53);
  }
  for (int i = 0; i < r; ++i) {
    for (int j = 0; j < c; ++j) {
      cout << mt[ans[i][j]];
    }
    cout << "\n";
  }
}
