#include <bits/stdc++.h>
const int MAXN = 1e2 + 5;
using namespace std;
char maze[MAXN][MAXN];
char mp[MAXN];
char ans[MAXN][MAXN];
int num[MAXN];
void init() {
  int tot = 1;
  for (int i = 0; i < 26; i++) mp[tot++] = char('a' + i);
  for (int i = 0; i < 26; i++) mp[tot++] = char('A' + i);
  for (int i = 0; i < 10; i++) mp[tot++] = char('0' + i);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  init();
  int T;
  cin >> T;
  while (T--) {
    int n, m, k;
    cin >> n >> m >> k;
    int cnt = 0;
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) {
        cin >> maze[i][j];
        if (maze[i][j] == 'R') {
          cnt++;
        }
      }
    }
    int p = cnt / k, q = cnt % k;
    for (int i = 1; i <= k; i++) {
      if (i <= q) {
        num[i] = p + 1;
      } else {
        num[i] = p;
      }
    }
    int color = 1;
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) {
        int k = j;
        if (i & 1) {
          k = m - j + 1;
        }
        if (maze[i][k] == 'R') {
          if (num[color] == 0) {
            color++;
          }
          num[color]--;
        }
        ans[i][k] = color;
      }
    }
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) {
        cout << mp[ans[i][j]];
      }
      cout << '\n';
    }
  }
}
