#include <bits/stdc++.h>
using namespace std;
string s[101];
char ans[101][101];
int main(int argc, char** argv) {
  int T;
  cin >> T;
  while (T--) {
    int r, c, k, rn = 0;
    scanf("%d%d%d", &r, &c, &k);
    getchar();
    for (int i = 0; i < r; i++) getline(cin, s[i]);
    for (int i = 0; i < r; i++)
      for (int j = 0; j < c; j++)
        if (s[i][j] == 'R') rn++;
    int a = rn / k;
    int y = rn - a * k;
    int x = (a + 1) * k - rn;
    int kd = -1;
    int sum = 0;
    for (int i = 0; i < r; i++) {
      if (i % 2 == 0)
        for (int j = 0; j < c; j++) {
          if (!sum && x) {
            x--;
            kd++;
            sum = a;
          } else if (!sum && y) {
            y--;
            kd++;
            sum = a + 1;
          }
          if (s[i][j] == 'R') sum--;
          if (kd < 26) {
            ans[i][j] = 'a' + kd;
          } else if (kd >= 26 && kd < 52) {
            ans[i][j] = 'A' + kd - 26;
          } else
            ans[i][j] = '0' + kd - 52;
        }
      else
        for (int j = c - 1; j >= 0; j--) {
          if (!sum && x) {
            kd++;
            sum = a;
            x--;
          } else if (!sum && y) {
            kd++;
            sum = a + 1;
            y--;
          }
          if (s[i][j] == 'R') sum--;
          if (kd < 26) {
            ans[i][j] = 'a' + kd;
          } else if (kd >= 26 && kd < 52) {
            ans[i][j] = 'A' + kd - 26;
          } else
            ans[i][j] = '0' + kd - 52;
        }
    }
    for (int i = 0; i < r; i++) {
      for (int j = 0; j < c; j++) printf("%c", ans[i][j]);
      printf("\n");
    }
  }
  return 0;
}
