#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
const int INF32 = ((~0) >> 1);
const int SZ = 1e6;
const int logSZ = 32;
const int SZ_2 = 2e4;
const long long INF64 = ((~0ull) >> 1);
const long double eps = 1e-2;
const long long P = 53;
const long double PI = acos(-1);
int r, c, k, cnt, now, sum;
int gt[62];
vector<char> arr;
vector<vector<char> > was, mp;
void dfs(int x, int y, int go = 1, int chicken = 0) {
  if (was[y][x]) return;
  was[y][x] = arr[chicken];
  if (mp[y][x] == 'R') {
    sum--;
    gt[chicken]--;
    if (!gt[chicken] && sum) chicken++;
  }
  if (go == 1)
    if (x + 1 > c || was[y][x + 1]) go = 2;
  if (go == 2)
    if (y + 1 > r || was[y + 1][x]) go = 3;
  if (go == 3)
    if (x - 1 <= 0 || was[y][x - 1]) go = 4;
  if (go == 4)
    if (y - 1 <= 0 || was[y - 1][x]) go = 1;
  if (go == 1) dfs(x + 1, y, go, chicken);
  if (go == 2) dfs(x, y + 1, go, chicken);
  if (go == 3) dfs(x - 1, y, go, chicken);
  if (go == 4) dfs(x, y - 1, go, chicken);
}
void Solve(int test_num) {
  cin >> r >> c >> k;
  was.clear();
  mp.clear();
  mp.resize(r + 1, vector<char>(c + 1));
  was.resize(r + 1, vector<char>(c + 1));
  cnt = 0;
  sum = 0;
  for (int i = 0; i < k; i++) gt[i] = 0;
  for (int i = 1; i <= r; i++)
    for (int j = 1; j <= c; j++) {
      cin >> mp[i][j];
      cnt += (mp[i][j] == 'R');
    }
  sum = cnt;
  cnt = cnt / k;
  for (int i = 0; i < k; i++) gt[i] = cnt;
  for (int i = 0; i < sum % k; i++) gt[i]++;
  dfs(1, 1);
  for (int i = 1; i <= r; i++) {
    for (int j = 1; j <= c; j++) cout << was[i][j];
    cout << endl;
  }
}
signed main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << fixed << setprecision(8);
  srand(time(NULL));
  for (char a = 'A'; a <= 'Z'; a++) arr.push_back(a);
  for (char a = 'a'; a <= 'z'; a++) arr.push_back(a);
  for (char a = '0'; a <= '9'; a++) arr.push_back(a);
  int test = 1;
  cin >> test;
  for (int i = 1; i <= test; i++) Solve(i);
}
