#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const string abc =
    "_qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890";
const long long N = 110;
string s[N];
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long r, c, k;
    cin >> r >> c >> k;
    long long sum = 0;
    for (long long i = 0; i < r; i++)
      cin >> s[i], sum += count(s[i].begin(), s[i].end(), 'R');
    long long cur = 0;
    for (long long i = 0; i < r; i++)
      if (i % 2 == 0)
        for (long long j = 0; j < c; j++) {
          if (s[i][j] == 'R' && (cur + 1) * k > sum) k--, sum -= cur, cur = 0;
          if (s[i][j] == 'R') cur++;
          s[i][j] = abc[k];
        }
      else
        for (long long j = c - 1; j >= 0; j--) {
          if (s[i][j] == 'R' && (cur + 1) * k > sum) k--, sum -= cur, cur = 0;
          if (s[i][j] == 'R') cur++;
          s[i][j] = abc[k];
        }
    for (long long i = 0; i < r; i++) cout << s[i] << "\n";
  }
}
