#include <bits/stdc++.h>
using namespace std;
string s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
void solve() {
  long long r, c, k;
  cin >> r >> c >> k;
  long long low = 0;
  long long sum = 0;
  vector<vector<char>> gr(r, vector<char>(c));
  for (long long i = 0; i < r; i++)
    for (long long j = 0; j < c; j++) {
      cin >> gr[i][j];
      sum += (gr[i][j] == 'R');
    }
  long long pp = sum / k, cur = 0;
  vector<long long> a(k);
  for (long long i = 0; i < k; i++) a[i] = pp;
  for (long long i = 0; i < sum % k; i++) a[i]++;
  for (long long i = 0; i < r; i++) {
    if (i % 2 == 0) {
      for (long long j = 0; j < c; j++) {
        cout << s[low];
        if (gr[i][j] == 'R') cur++;
        if (cur == a[low] && (low + 1) != k) {
          low++;
          cur = 0;
        }
      }
    } else if (i % 2 == 1) {
      string sw = "";
      for (long long j = c - 1; j > -1; j--) {
        sw += s[low];
        if (gr[i][j] == 'R') cur++;
        if (cur == a[low] && (low + 1) != k) {
          low++;
          cur = 0;
        }
      }
      reverse(sw.begin(), sw.end());
      cout << sw;
    }
    cout << endl;
  }
}
signed main() {
  long long t;
  cin >> t;
  while (t) {
    solve();
    t--;
  }
}
