#include <bits/stdc++.h>
using namespace std;
string validCharacters =
    "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
int main() {
  int t, r, c, k;
  scanf("%d", &t);
  while (t--) {
    scanf("%d %d %d", &r, &c, &k);
    char arr[r][c], ans[r][c];
    int counter = 0;
    for (int i = 0; i < r; i++) {
      for (int j = 0; j < c; j++) {
        scanf(" %c", &arr[i][j]);
        if (arr[i][j] == 'R') counter++;
      }
    }
    int opt[k], aux = 0, offset = 0;
    bool flag = true, flag_I = false;
    if (counter % k == 0) {
      for (int i = 0; i < k; i++) opt[i] = counter / k;
    } else {
      for (int i = 0; i < k; i++) {
        if (i >= k - (counter % k))
          opt[i] = (counter / k) + 1;
        else
          opt[i] = counter / k;
      }
    }
    for (int i = 0; i < r; i++) {
      for (int j = (flag) ? 0 : c - 1; j >= 0 && j < c; j += (flag) ? 1 : -1) {
        ans[i][j] = validCharacters[min(offset, k - 1)];
        if (arr[i][j] == 'R') {
          aux++;
          if (aux == opt[offset]) {
            aux = 0;
            offset++;
          }
        }
      }
      flag = !flag;
    }
    for (int i = 0; i < r; i++) {
      for (int j = 0; j < c; j++) {
        printf("%c", ans[i][j]);
      }
      printf("\n");
    }
  }
  return 0;
}
