#include <bits/stdc++.h>
using namespace std;
vector<long long> v1, v2;
long long N, M, K, Q, T;
vector<long long> vl;
vector<vector<char>> vadj;
map<long long, vector<vector<long long>>> mp;
vector<char> vc;
vector<vector<char>> ans;
int main() {
  cin >> T;
  vc.resize(62);
  for (long long i = 'a'; i < 'z' + 1; i++) vc[i - 'a'] = i;
  for (long long i = 'A'; i < 'Z' + 1; i++) vc[i - 'A' + 26] = i;
  for (long long i = 52; i < 62; i++) vc[i] = '0' + (i - 52);
  for (long long k = 0; k < T; k++) {
    ans.clear();
    vadj.clear();
    cin >> N >> M >> K;
    long long rice = 0;
    vadj.resize(N);
    for (long long i = 0; i < N; i++) vadj[i].resize(M);
    ans.resize(N);
    for (long long i = 0; i < N; i++) ans[i].resize(M);
    for (long long i = 0; i < N; i++) {
      for (long long j = 0; j < M; j++) {
        cin >> vadj[i][j];
        if (vadj[i][j] == 'R') rice++;
      }
    }
    long long cuantos = rice / K;
    vl.resize(K);
    rice -= cuantos * K;
    for (long long i = 0; i < K; i++) vl[i] = cuantos;
    long long donde = 0;
    while (rice > 0) {
      vl[donde]++;
      rice--;
      donde++;
    }
    long long x = 0;
    long long y = 0;
    long long pajaro = 0;
    long long cuan = 0;
    while (pajaro < K) {
      if (vadj[x][y] == 'R') cuan++;
      ans[x][y] = vc[pajaro];
      if (cuan == vl[pajaro]) {
        cuan = 0;
        pajaro++;
      }
      if (x % 2 == 0)
        y++;
      else
        y--;
      if (y < 0) {
        y = 0;
        x++;
      } else if (y >= M) {
        y = M - 1;
        x++;
      }
    }
    pajaro--;
    while (x < N) {
      ans[x][y] = vc[pajaro];
      if (x % 2 == 0)
        y++;
      else
        y--;
      if (y < 0) {
        y = 0;
        x++;
      } else if (y >= M) {
        y = M - 1;
        x++;
      }
    }
    for (long long i = 0; i < N; i++) {
      for (long long j = 0; j < M; j++) {
        cout << ans[i][j];
      }
      cout << endl;
    }
  }
}
