#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1, -1, -1, 0, 1, -1, 0, 1};
char s[105][105];
int vis[105][105];
string pp, p;
int main() {
  int t, tt = 1;
  for (int i = 0; i < (26); i++) pp.push_back('a' + i);
  for (int i = 0; i < (26); i++) pp.push_back('A' + i);
  for (int i = 0; i < (10); i++) pp.push_back('0' + i);
  pp.push_back('9');
  scanf("%d", &t);
  while (t--) {
    int n, m, k;
    scanf("%d %d %d", &n, &m, &k);
    p.clear();
    for (int i = 0; i < (k); i++) {
      p.push_back(pp[i]);
    }
    p.push_back(pp[k - 1]);
    int cnt = 0;
    for (int i = 0; i < (n); i++) scanf("%s", s[i]);
    for (int i = 0; i < (n); i++)
      for (int j = 0; j < (m); j++) {
        if (s[i][j] == 'R') cnt++;
        vis[i][j] = 0;
      }
    int a[65];
    memset((a), 0, sizeof(a));
    int tot = cnt / k;
    int rst = cnt % k;
    for (int i = 0; i < (k); i++) {
      a[i] = tot;
      if (rst > 0) a[i]++;
      rst--;
    }
    a[k] = 2e5;
    int id = 0;
    int x = 0, y = 0;
    while (true) {
      if (vis[x][y]) break;
      while (!vis[x][y] && y < m) {
        if (s[x][y] == 'R') a[id]--;
        s[x][y] = p[id];
        if (!a[id]) id++;
        vis[x][y] = 1;
        y++;
      }
      y--;
      x++;
      if (vis[x][y] || y < 0 || x >= n) break;
      while (!vis[x][y] && x < n) {
        if (s[x][y] == 'R') a[id]--;
        s[x][y] = p[id];
        if (!a[id]) id++;
        vis[x][y] = 1;
        x++;
      }
      y--;
      x--;
      if (vis[x][y] || y < 0 || x < 0) break;
      while (!vis[x][y] && y >= 0) {
        if (s[x][y] == 'R') {
          a[id]--;
        }
        s[x][y] = p[id];
        if (!a[id]) id++;
        vis[x][y] = 1;
        y--;
      }
      y++;
      x--;
      if (vis[x][y] || y >= m || x < 0) break;
      while (!vis[x][y] && x >= 0) {
        if (s[x][y] == 'R') a[id]--;
        s[x][y] = p[id];
        if (!a[id]) id++;
        vis[x][y] = 1;
        x--;
      }
      y++;
      x++;
      if (vis[x][y] || y >= m || x >= n) break;
    }
    for (int i = 0; i < (n); i++) printf("%s\n", s[i]);
  }
  return 0;
}
