#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
char a[110][110];
char f(int x) {
  if (x < 10) {
    return x + '0';
  }
  if (x < 36) {
    return x - 10 + 'a';
  }
  return x - 36 + 'A';
}
char ans[110][110];
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
void solve() {
  int r, c, k;
  scanf("%d%d%d", &r, &c, &k);
  int cnt = 0;
  for (int i = 0; i < r; ++i) {
    for (int j = 0; j < c; ++j) {
      ans[i][j] = 0;
      scanf(" %c", &a[i][j]);
      cnt += a[i][j] == 'R';
    }
  }
  int d = cnt / k;
  vector<int> res;
  for (int i = 0; i < k; ++i) {
    res.push_back(d);
  }
  for (int i = 0; i < cnt % k; ++i) {
    res[i]++;
  }
  int dir = 0;
  int i = 0, j = 0, curcnt = 0, cur = 0;
  while (1) {
    if (a[i][j] == 'R') {
      curcnt++;
      if (curcnt == res[cur] + 1) {
        cur++;
        curcnt = 1;
      }
    }
    ans[i][j] = f(cur);
    i += dx[dir];
    j += dy[dir];
    if (i == -1 || j == -1 || i == r || j == c || ans[i][j]) {
      i -= dx[dir];
      j -= dy[dir];
      dir = (dir + 1) % 4;
      i += dx[dir];
      j += dy[dir];
      if (i == -1 || j == -1 || i == r || j == c || ans[i][j]) {
        break;
      }
    }
  }
  for (int i = 0; i < r; ++i) {
    for (int j = 0; j < c; ++j) {
      printf("%c", ans[i][j]);
    }
    printf("\n");
  }
}
int main() {
  int t;
  scanf("%d", &t);
  for (int i = 0; i < t; ++i) {
    solve();
  }
  return 0;
}
