#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const char p[] =
    "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
char a[110][110], ans[110][110];
int main(void) {
  int T;
  scanf("%d", &T);
  while (T--) {
    int r, c, k;
    scanf("%d%d%d", &r, &c, &k);
    for (int i = 1; i <= r; ++i) {
      scanf("%s", a[i] + 1);
    }
    int cnt = 0;
    for (int i = 1; i <= r; ++i) {
      for (int j = 1; j <= c; ++j) {
        if (a[i][j] == 'R') cnt++;
      }
    }
    int per = cnt / k, pls = cnt % k, now = 0, pcnt = 0;
    for (int i = 1; i <= r; ++i) {
      if (i % 2) {
        for (int j = 1; j <= c; ++j) {
          if (a[i][j] == 'R') pcnt++;
          if (pls && pcnt == per + 2) {
            now++;
            pcnt = 1;
            pls--;
          } else if (!pls && pcnt == per + 1) {
            now++;
            pcnt = 1;
          }
          ans[i][j] = p[now];
        }
      } else {
        for (int j = c; j >= 1; --j) {
          if (a[i][j] == 'R') pcnt++;
          if (pls && pcnt == per + 2) {
            now++;
            pcnt = 1;
            pls--;
          } else if (!pls && pcnt == per + 1) {
            now++;
            pcnt = 1;
          }
          ans[i][j] = p[now];
        }
      }
    }
    for (int i = 1; i <= r; ++i) {
      for (int j = 1; j <= c; ++j) {
        printf("%c", ans[i][j]);
      }
      printf("\n");
    }
  }
  return 0;
}
