#include <bits/stdc++.h>
using namespace std;
const long long int N = 3 * 1e6 + 2;
long long int n, k;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  vector<char> chicken;
  for (char c = 'a'; c <= 'z'; ++c) chicken.push_back(c);
  for (char c = 'A'; c <= 'Z'; ++c) chicken.push_back(c);
  for (long long int i = 0; i < 10; ++i) chicken.push_back(char(i + '0'));
  long long int tt;
  cin >> tt;
  for (long long int qq = 1; qq <= tt; ++qq) {
    long long int m;
    cin >> n >> m >> k;
    vector<vector<char>> v(n + 1, vector<char>(m + 1));
    long long int tot = 0;
    for (long long int i = 1; i <= n; ++i)
      for (long long int j = 1; j <= m; ++j) {
        cin >> v[i][j];
        if (v[i][j] == 'R') ++tot;
      }
    long long int need = tot / k;
    long long int rem = tot % k;
    long long int id = 0, cur = 0;
    for (long long int i = 1; i <= n; ++i) {
      if (i & 1) {
        for (long long int j = 1; j <= m; ++j) {
          if (v[i][j] == 'R') ++cur;
          if (cur > (need + (rem > 0))) {
            v[i][j] = chicken[++id];
            cur = 1;
            if (rem) rem--;
          } else {
            v[i][j] = chicken[id];
          }
        }
      } else {
        for (long long int j = m; j >= 1; j--) {
          if (v[i][j] == 'R') ++cur;
          if (cur > (need + (rem > 0))) {
            v[i][j] = chicken[++id];
            cur = 1;
            if (rem) rem--;
          } else {
            v[i][j] = chicken[id];
          }
        }
      }
    }
    for (long long int i = 1; i <= n; ++i) {
      for (long long int j = 1; j <= m; ++j) {
        cout << v[i][j];
      }
      cout << '\n';
    }
  }
  return 0;
}
