#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const int maxn = 1e3 + 10;
int r, c, k;
char g[maxn][maxn], ans[maxn][maxn];
char color(int x) {
  if (x < 26) return 'a' + x;
  if (x < 52) return 'A' + (x - 26);
  return '0' + (x - 52);
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%d %d %d", &r, &c, &k);
    int cnt = 0;
    for (int i = 1; i <= r; i++) {
      getchar();
      for (int j = 1; j <= c; j++) {
        g[i][j] = getchar();
        if (g[i][j] == 'R') cnt++;
      }
    }
    int id = 0, sum = 0;
    for (int i = 1; i <= r; i++) {
      if (i & 1) {
        for (int j = 1; j <= c; j++) {
          ans[i][j] = color(id);
          if (g[i][j] == 'R') {
            sum++;
            if (id < k - 1 && id < cnt % k && sum == cnt / k + 1) {
              sum = 0;
              id++;
            }
            if (id < k - 1 && id >= cnt % k && sum == cnt / k) {
              sum = 0;
              id++;
            }
          }
        }
      } else {
        for (int j = c; j >= 1; j--) {
          ans[i][j] = color(id);
          if (g[i][j] == 'R') {
            sum++;
            if (id < k - 1 && id < cnt % k && sum == cnt / k + 1) {
              sum = 0;
              id++;
            }
            if (id < k - 1 && id >= cnt % k && sum == cnt / k) {
              sum = 0;
              id++;
            }
          }
        }
      }
    }
    for (int i = 1; i <= r; i++) {
      for (int j = 1; j <= c; j++) putchar(ans[i][j]);
      putchar('\n');
    }
  }
  return 0;
}
