#include <bits/stdc++.h>
using namespace std;
int r, c, k;
char s[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
char gri[219][219];
char ans[219][219];
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d%d", &r, &c, &k);
    for (register int i = 1; i <= r; i++) scanf("%s", gri[i] + 1);
    int cnt = 0;
    for (register int i = 1; i <= r; i++)
      for (register int j = 1; j <= c; j++)
        if (gri[i][j] == 'R') cnt++;
    int x = 1, y = 1, d = 1, num = cnt / k, num2 = cnt - k * num;
    for (register int i = 1; i <= k; i++) {
      int init;
      if (!num2)
        init = num;
      else
        num2--, init = num + 1;
      if (i < k) {
        while (init) {
          if (gri[x][y] == 'R') init--;
          ans[x][y] = s[i - 1];
          y += d;
          if (y > c)
            x++, d = -d, y = c;
          else if (y < 1)
            x++, d = -d, y = 1;
        }
      } else {
        while (x <= r) {
          if (gri[x][y] == 'R') init--;
          ans[x][y] = s[i - 1];
          y += d;
          if (y > c)
            x++, d = -d, y = c;
          else if (y < 1)
            x++, d = -d, y = 1;
        }
      }
    }
    for (register int i = 1; i <= r; i++) {
      for (register int j = 1; j <= c; j++) printf("%c", ans[i][j]);
      printf("\n");
    }
  }
  return 0;
}
