#include <bits/stdc++.h>
int main() {
  char book[62];
  for (int i = 0; i < 26; i++) book[i] = 'a' + i;
  for (int i = 26; i < 52; i++) book[i] = 'A' + i - 26;
  for (int i = 52; i < 62; i++) book[i] = '0' + i - 52;
  int t;
  scanf("%d", &t);
  for (int i = 0; i < t; i++) {
    int r, c, k;
    scanf("%d%d%d", &r, &c, &k);
    char a[r][c];
    char ans[r][c];
    int count = 0;
    for (int j = 0; j < r; j++) {
      scanf("%s", a[j]);
      for (int i = 0; i < c; i++) {
        if (a[j][i] == 'R') count++;
      }
    }
    int num[k];
    memset(num, 0, sizeof(num));
    int x = count / k;
    int y = count % k;
    for (int i = 0; i < k; i++) {
      if (i < y)
        num[i] = x + 1;
      else
        num[i] = x;
    }
    int now = 0;
    for (int i = 0; i < r; i++)
      for (int j = 0; j < c; j++) {
        int m = j;
        if (i % 2 != 0) m = c - j - 1;
        if (num[now] == 0 && now != k - 1) {
          now++;
        }
        if (a[i][m] == 'R') {
          num[now]--;
        }
        ans[i][m] = book[now];
      }
    for (int i = 0; i < r; i++) {
      for (int j = 0; j < c; j++) {
        printf("%c", ans[i][j]);
      }
      printf("\n");
    }
  }
  return 0;
}
