#include <bits/stdc++.h>
using namespace std;
int n, m, k;
char ga[62], a[105][105], ans[105][105];
int rice[62];
void init() {
  int pos = 0;
  for (int i = (int)'a'; i <= (int)'z'; i++) ga[pos++] = char(i);
  for (int i = (int)'A'; i <= (int)'Z'; i++) ga[pos++] = char(i);
  for (int i = (int)'0'; i <= (int)'9'; i++) ga[pos++] = char(i);
}
void solve() {
  cin >> n >> m >> k;
  int cnt = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
      ans[i][j] = '*';
      cnt += (a[i][j] == 'R');
    }
  for (int i = 0; i < k; i++) rice[i] = cnt / k;
  for (int i = 0; i < cnt % k; i++) rice[i]++;
  int huong = 0;
  int x = 0, y = 0, pos = 0;
  while (pos < k) {
    cnt = 0;
    while (cnt < rice[pos]) {
      ans[x][y] = ga[pos];
      if (a[x][y] == 'R') cnt++;
      if (huong == 0) {
        if (y + 1 == m) {
          y = m - 1;
          huong ^= 1;
          x++;
        } else
          y++;
      } else {
        if (y - 1 == -1) {
          y = 0;
          huong ^= 1;
          x++;
        } else
          y--;
      }
    }
    pos++;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++)
      if (ans[i][j] != '*')
        cout << ans[i][j];
      else
        cout << ga[pos - 1];
    cout << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  init();
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
