#include <bits/stdc++.h>
using namespace std;
int main() {
  long long(t);
  scanf("%lld", &(t));
  ;
  string ex = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
  while (t--) {
    long long(n), (m), (k);
    scanf("%lld%lld%lld", &(n), &(m), &(k));
    ;
    vector<string> A(n);
    long long c = 0;
    for (long long i = 0; i < (n); i++) {
      string(s);
      cin >> (s);
      ;
      A[i] = s;
      for (long long j = 0; j < (m); j++)
        if (A[i][j] == 'R') c++;
    }
    string temp = "";
    for (long long i = 0; i < (m); i++) temp += ' ';
    vector<string> res(n, temp);
    long long q = c / k, rem = c % k;
    long long flag = 1;
    if (!rem) flag = 0;
    long long l = 0, r = m - 1, t = 0, b = n - 1;
    long long dir = 0, d = 0;
    unordered_map<long long, pair<long long, long long> > res1;
    while (l <= r && t <= b) {
      if (dir == 0) {
        for (long long i = l; i <= r; i++) {
          res1[d] = {t, i};
          d++;
        }
        t++;
        dir = 1;
      } else if (dir == 1) {
        for (long long i = t; i <= b; i++) {
          res1[d] = {i, r};
          d++;
        }
        r--;
        dir = 2;
      } else if (dir == 2) {
        for (long long i = r; i >= l; i--) {
          res1[d] = {b, i};
          d++;
        }
        b--;
        dir = 3;
      } else if (dir == 3) {
        for (long long i = b; i >= t; i--) {
          res1[d] = {i, l};
          d++;
        }
        l++;
        dir = 0;
      }
    }
    long long e = 0, g = 0, flag2 = 0;
    for (long long i = 0; i < (m * n); i++) {
      long long x = res1[i].first, y = res1[i].second;
      res[x][y] = ex[e];
      if (flag2) continue;
      if (A[x][y] == 'R') {
        g++;
        if (flag && g == 1 + q) {
          rem--;
          if (rem == 0) flag = 0;
          e++;
          g = 0;
          k--;
        } else if (!flag && g == q) {
          e++;
          g = 0;
          k--;
        }
        if (k == 0) {
          flag2 = 1;
          e--;
        }
      }
    }
    for (long long i = 0; i < (n); i++) {
      cout << res[i] << "\n";
    }
  }
  return 0;
}
