#include <bits/stdc++.h>
using namespace std;
template <class X, class Y>
bool minimize(X &x, const Y &y) {
  X eps = 1e-9;
  if (x > y + eps) {
    x = y;
    return true;
  } else
    return false;
}
template <class X, class Y>
bool maximize(X &x, const Y &y) {
  X eps = 1e-9;
  if (x + eps < y) {
    x = y;
    return true;
  } else
    return false;
}
template <class T>
T Abs(const T &x) {
  return (x < 0 ? -x : x);
}
const string SYMBOLS =
    "QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890";
char board[111][111], res[111][111];
int numRow, numCol, numChicken;
void process(void) {
  memset(board, 0, sizeof board);
  memset(res, 0, sizeof res);
  scanf("%d%d%d", &numRow, &numCol, &numChicken);
  for (int i = (1), _b = (numRow); i <= _b; i++) scanf("%s", board[i] + 1);
  bool leftToRight = true;
  vector<pair<int, int>> cells;
  for (int i = (1), _b = (numRow); i <= _b; i++) {
    if (leftToRight) {
      for (int j = (1), _b = (numCol); j <= _b; j++)
        cells.push_back(make_pair(i, j));
    } else {
      for (int j = (numCol), _a = (1); j >= _a; j--)
        cells.push_back(make_pair(i, j));
    }
    leftToRight ^= 1;
  }
  int totRice = 0;
  for (int i = (1), _b = (numRow); i <= _b; i++)
    for (int j = (1), _b = (numCol); j <= _b; j++)
      if (board[i][j] == 'R') totRice++;
  int avg = totRice / numChicken;
  int diff = totRice % numChicken == 0 ? 0 : 1;
  for (int i = 0, _n = (numChicken); i < _n; i++) {
    int cntRice = 0;
    while (true) {
      int x = cells.back().first, y = cells.back().second;
      cells.pop_back();
      res[x][y] = SYMBOLS[i];
      if (board[x][y] == 'R') {
        totRice--;
        cntRice++;
      }
      if (cntRice < avg) continue;
      if (avg * (numChicken - i - 1) <= totRice &&
          totRice <= (avg + diff) * (numChicken - i - 1))
        break;
    }
  }
  while (!cells.empty()) {
    int x = cells.back().first, y = cells.back().second;
    cells.pop_back();
    res[x][y] = SYMBOLS[numChicken - 1];
  }
  for (int i = (1), _b = (numRow); i <= _b; i++) {
    for (int j = (1), _b = (numCol); j <= _b; j++) printf("%c", res[i][j]);
    printf("\n");
  }
}
int main(void) {
  int t;
  scanf("%d", &t);
  for (int love = 0, _n = (t); love < _n; love++) process();
  return 0;
}
