#include <bits/stdc++.h>
using namespace std;
const int N = 110, mod = 1e9 + 7, INF = 0x3f3f3f3f;
const double eps = 1e-6;
int tot, n, m, k;
char s[N][N];
map<int, char> mp;
int main() {
  for (int i = 1; i <= 26; i++) mp[i] = 'a' + i - 1;
  for (int i = 1, j = 27; i <= 26; i++, j++) mp[j] = 'A' + i - 1;
  for (int i = 0, j = 53; i <= 9; i++, j++) mp[j] = '0' + i;
  int _;
  scanf("%d", &_);
  while (_--) {
    tot = 0;
    int cnt = 0;
    scanf("%d%d%d", &n, &m, &k);
    for (int i = 1; i <= n; i++) {
      scanf("%s", s[i] + 1);
      for (int j = 1; j <= m; j++)
        if (s[i][j] == 'R') cnt++, s[i][j] = '[';
    }
    int num = cnt / k;
    for (int i = 1; i <= cnt % k; i++) {
      char ch = mp[++tot];
      int c = num + 1;
      for (int i = 1; i <= n && c; i++) {
        if (i % 2 == 1) {
          for (int j = 1; j <= m && c; j++) {
            if (s[i][j] != '.' && s[i][j] != '[') continue;
            if (s[i][j] == '[') c--;
            s[i][j] = ch;
          }
        } else {
          for (int j = m; j >= 1 && c; j--) {
            if (s[i][j] != '.' && s[i][j] != '[') continue;
            if (s[i][j] == '[') c--;
            s[i][j] = ch;
          }
        }
      }
    }
    for (int i = 1; i <= k - cnt % k; i++) {
      char ch = mp[++tot];
      int c = num;
      for (int i = 1; i <= n && c; i++) {
        if (i % 2 == 1)
          for (int j = 1; j <= m && c; j++) {
            if (s[i][j] != '.' && s[i][j] != '[') continue;
            if (s[i][j] == '[') c--;
            s[i][j] = ch;
          }
        else
          for (int j = m; j >= 1 && c; j--) {
            if (s[i][j] != '.' && s[i][j] != '[') continue;
            if (s[i][j] == '[') c--;
            s[i][j] = ch;
          }
      }
    }
    char ch = mp[tot];
    for (int i = 1; i <= n; i++) {
      if (i % 2 == 1)
        for (int j = 1; j <= m; j++) {
          if (s[i][j] != '.' && s[i][j] != '[') continue;
          s[i][j] = ch;
        }
      else
        for (int j = m; j >= 1; j--) {
          if (s[i][j] != '.' && s[i][j] != '[') continue;
          s[i][j] = ch;
        }
    }
    for (int i = 1; i <= n; i++) printf("%s\n", s[i] + 1);
  }
  return 0;
}
