#include <bits/stdc++.h>
using namespace std;
int dy[] = {0, 1, 0, -1};
int dx[] = {1, 0, -1, 0};
char s[] = "0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
const int MAX = 120;
int T, N, M, K;
int vis[MAX][MAX];
char m[MAX][MAX];
int cnt, now;
int aux;
bool check(int i, int j) { return (i >= 0 && i < N && j >= 0 && j < M); }
void solve(int i, int j, int d, int k) {
  if (m[i][j] == 'R') k++;
  m[i][j] = s[now];
  vis[i][j] = 1;
  if (now < cnt % K && k == cnt / K + 1 && now < K - 1) {
    now++;
    k = 0;
  }
  if (now >= cnt % K && k == cnt / K && now < K - 1) {
    now++;
    k = 0;
  }
  int y = i + dy[d];
  int x = j + dx[d];
  if (!check(y, x) || vis[y][x]) d++;
  if (d == 4) d = 0;
  y = i + dy[d];
  x = j + dx[d];
  if (check(y, x) && !vis[y][x]) solve(y, x, d, k);
}
int main(int argc, char** argv) {
  scanf("%d", &T);
  for (int t = (0); t < (T); t++) {
    aux = now = cnt = 0;
    scanf("%d%d%d", &N, &M, &K);
    for (int i = (0); i < (N); i++) scanf(" %s", m[i]);
    for (int i = (0); i < (N); i++)
      for (int j = (0); j < (M); j++) cnt += (m[i][j] == 'R');
    solve(0, 0, 0, 0);
    for (int i = (0); i < (N); i++) printf("%s\n", m[i]);
    memset(vis, 0, sizeof vis);
  }
  return 0;
}
