#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3fll;
const int N = 100 + 10;
const int M = 300 + 10;
const int maxn = 1e3 + 10;
const int mod = (int)1e9 + 7;
const double eps = 1e-10;
const double pi = acos(-1.0);
int r, c, k, x, y, pos;
char g[N][N];
char ans[N][N];
const char s[] =
    "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
bool in(int x, int y) { return 1 <= x && x <= r && 1 <= y && y <= c; }
void solve(int num, int id) {
  while (num) {
    ans[x][y] = s[id];
    if (g[x][y] == 'R') num--;
    g[x][y] = 0;
    int xx = x + dx[pos];
    int yy = y + dy[pos];
    if (!in(xx, yy) || (g[xx][yy] != 'R' && g[xx][yy] != '.')) {
      pos = (pos + 1) % 4;
      xx = x + dx[pos];
      ;
      yy = y + dy[pos];
    }
    if (!in(xx, yy) || (g[xx][yy] != 'R' && g[xx][yy] != '.')) break;
    x = xx;
    y = yy;
  }
}
void work() {
  cin >> r >> c >> k;
  int cnt = 0;
  for (int i = 1; i <= r; i++) {
    cin >> g[i] + 1;
    for (int j = 1; j <= c; j++)
      if (g[i][j] == 'R') cnt++;
  }
  int d = cnt / k;
  int h = cnt % k;
  x = 1;
  y = 1;
  pos = 0;
  for (int i = 0; i < k; i++) {
    int num = d;
    if (i <= h - 1) num++;
    solve(num, i);
  }
  solve(inf, k - 1);
  for (int i = 1; i <= r; i++) {
    ans[i][c + 1] = 0;
    cout << ans[i] + 1 << '\n';
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) work();
  return 0;
}
