#include <bits/stdc++.h>
using namespace std;
char s[100];
int T, n, m, k, a[100], b[20000][2];
bool t[200][200];
char ans[200][200];
int main() {
  for (int i = 0; i < 10; ++i) s[i] = '0' + i;
  for (int i = 0; i < 26; ++i) s[10 + i] = 'A' + i;
  for (int i = 0; i < 26; ++i) s[36 + i] = 'a' + i;
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d%d", &n, &m, &k);
    int r = 0;
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= m; ++j) {
        char c = getchar();
        while (c != '.' && c != 'R') c = getchar();
        if (c == 'R')
          t[i][j] = 1, ++r;
        else
          t[i][j] = 0;
      }
    for (int i = 0; i < k; ++i) a[i] = r / k;
    for (int i = 0; i < r % k; ++i) ++a[i];
    int tot = 0;
    for (int i = 1; i <= n; ++i)
      if (i & 1)
        for (int j = 1; j <= m; ++j) b[++tot][0] = i, b[tot][1] = j;
      else
        for (int j = m; j; --j) b[++tot][0] = i, b[tot][1] = j;
    for (int i = 1, j = 0; i <= tot; ++i) {
      int x = b[i][0], y = b[i][1];
      ans[x][y] = s[j];
      if (t[x][y])
        if (!--a[j] && j + 1 < k) ++j;
    }
    for (int i = 1; i <= n; puts(""), ++i)
      for (int j = 1; j <= m; ++j) putchar(ans[i][j]);
  }
}
