#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int dx[8] = {1, -1, 0, 0, -1, -1, 1, 1};
int dy[8] = {0, 0, -1, 1, -1, 1, -1, 1};
vector<int> adj[300010], adj1[300010];
vector<int> dis(200010);
int myrandom(int i) { return std::rand() % i; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n, m, k;
    cin >> n >> m >> k;
    vector<vector<char>> vis(n, vector<char>(m));
    vector<pair<char, int>> typ;
    vector<string> v(n);
    int cnt = 0;
    for (long long i = 0; i < n; i++) {
      cin >> v[i];
    }
    for (long long i = 0; i < n; i++) {
      for (long long j = 0; j < m; j++) {
        if (v[i][j] == 'R') cnt++;
      }
    }
    int q = cnt / k, r = cnt % k;
    set<char> st;
    for (int i = 0; i < 26; i++) {
      st.insert('a' + i);
      st.insert('A' + i);
      if (i < 10) {
        st.insert('0' + i);
      }
    }
    int i = 0;
    typ.clear();
    for (auto itr = st.begin(); itr != st.end(); itr++) {
      if (i < k) {
        if (i < r) {
          typ.push_back({*itr, q + 1});
        } else {
          typ.push_back({*itr, q});
        }
        i++;
      } else {
        break;
      }
    }
    int l = 0, flag = 0;
    cnt = 0;
    for (int i = 0; i < n; i++) {
      if (flag == 1) {
        flag = 0;
        for (int j = m - 1; j >= 0; j--) {
          if (v[i][j] == 'R') cnt++;
          vis[i][j] = typ[l].first;
          if (l < (int)typ.size() - 1 && cnt >= typ[l].second) {
            cnt = 0;
            l++;
          }
        }
      } else {
        flag = 1;
        for (int j = 0; j < m; j++) {
          if (v[i][j] == 'R') cnt++;
          vis[i][j] = typ[l].first;
          if (l < (int)typ.size() - 1 && cnt >= typ[l].second) {
            cnt = 0;
            l++;
          }
        }
      }
    }
    for (long long i = 0; i < n; i++) {
      for (long long j = 0; j < m; j++) {
        cout << vis[i][j];
      }
      cout << '\n';
    }
  }
}
