#include <bits/stdc++.h>
using namespace std;
int t, n, m, k, target, res;
char ans[63];
char mp[105][105];
char ANS[105][105];
void srh(int x, int y, int num, int cnt) {
  cnt += mp[x][y] == 'R';
  ANS[x][y] = ans[num];
  int nx = x, ny = y + ((x & 1) ? 1 : -1);
  if (ny < 1 || ny > m) {
    nx++;
    if (nx > n) return;
    if (ny < 1)
      ny = 1;
    else
      ny = m;
  }
  if (res) {
    if (cnt >= target + 1 && num > 1) {
      res--;
      srh(nx, ny, num - 1, 0);
    } else
      srh(nx, ny, num, cnt);
  } else if (cnt >= target && num > 1)
    srh(nx, ny, num - 1, 0);
  else
    srh(nx, ny, num, cnt);
}
int main() {
  for (int i = 1; i <= 26; i++) ans[i] = 'a' + i - 1, ans[i + 26] = 'A' + i - 1;
  for (int i = 0; i < 10; i++) ans[53 + i] = '0' + i;
  scanf("%d", &t);
  while (t--) {
    scanf("%d%d%d", &n, &m, &k);
    int sum = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%s", mp[i] + 1);
      for (int j = 1; j <= m; j++) {
        if (mp[i][j] == 'R') sum++;
      }
    }
    target = sum / k;
    res = sum % k;
    srh(1, 1, k, 0);
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) printf("%c", ANS[i][j]);
      printf("\n");
    }
  }
}
