#include <bits/stdc++.h>
using namespace std;
char ans[110][110], s[110][110];
char nextt(char ch) {
  if (ch == 'z')
    return 'A';
  else if (ch == 'Z')
    return '0';
  else
    return ch + 1;
}
int main() {
  int t, n, m, k;
  scanf("%d", &t);
  while (t--) {
    scanf("\n%d%d%d", &n, &m, &k);
    int nr = 0;
    for (int i = 1; i <= n; i++) {
      scanf("\n%s", s[i] + 1);
      for (int j = 1; j <= m; j++)
        if (s[i][j] == 'R') nr++;
    }
    int a = nr / k;
    int b = nr % k;
    int p = 1;
    int cnt = 1;
    char ch = 'a';
    nr = 0;
    if (b == 0) p = 0;
    for (int i = 1; i <= n; i++) {
      if (i % 2 == 1) {
        for (int j = 1; j <= m; j++) {
          if (s[i][j] == 'R') nr++;
          ans[i][j] = ch;
          if (nr == a + p && cnt < k) {
            ch = nextt(ch);
            nr = 0;
            b--;
            if (b == 0) p = 0;
            cnt++;
          }
        }
      } else {
        for (int j = m; j >= 1; j--) {
          if (s[i][j] == 'R') nr++;
          ans[i][j] = ch;
          if (nr == a + p && cnt < k) {
            ch = nextt(ch);
            nr = 0;
            b--;
            if (b == 0) p = 0;
            cnt++;
          }
        }
      }
    }
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) printf("%c", ans[i][j]);
      printf("\n");
    }
  }
  return 0;
}
