#include <bits/stdc++.h>
using namespace std;
int t, r, c, k;
char a[105][105];
int num, x[105], now, nowx, nowy, nownum;
int ans[105][105];
string ch = " 0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
int main() {
  cin >> t;
  while (t--) {
    cin >> r >> c >> k;
    num = 0;
    for (int i = 1; i <= r; i++)
      for (int j = 1; j <= c; j++) {
        cin >> a[i][j];
        if (a[i][j] == 'R') num++;
      }
    for (int i = 1; i <= k; i++) x[i] = num / k;
    for (int i = 1; i <= num % k; i++) x[i]++;
    now = 1, nowx = 1, nowy = 1;
    nownum = 0;
    while (nowx <= r) {
      if (a[nowx][nowy] == 'R') {
        if (nownum >= x[now]) now++, nownum = 0;
        nownum++;
      }
      ans[nowx][nowy] = now;
      if (nowx % 2 == 1)
        nowy++;
      else
        nowy--;
      if (nowy < 1) nowy = 1, nowx++;
      if (nowy > c) nowy = c, nowx++;
    }
    for (int i = 1; i <= r; i++) {
      for (int j = 1; j <= c; j++) cout << ch[ans[i][j]];
      cout << endl;
    }
  }
  return 0;
}
