#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000005;
const int SQRTN = 1003;
const int LOGN = 22;
const double PI = acos(-1);
const int INF = 1e9;
int MOD = 1000000007;
const int FMOD = 998244353;
const double eps = 1e-9;
char arr[105][105];
long long ans[105][105];
void solve() {
  long long r, c, k;
  cin >> r >> c >> k;
  for (long long i = 1; i <= r; i++) {
    for (long long j = 1; j <= c; j++) cin >> arr[i][j];
  }
  long long cnt = 0;
  for (long long i = 1; i <= r; i++) {
    for (long long j = 1; j <= c; j++) {
      if (arr[i][j] == 'R') cnt++;
    }
  }
  long long cnt1 = cnt / k;
  long long cnt2 = cnt % k;
  long long count = 0;
  long long temp = 0;
  for (long long i = 1; i <= r; i++) {
    if (i % 2 == 0) {
      long long j = 1;
      while (j <= c) {
        if (arr[i][j] == 'R') count++;
        ans[i][j] = temp;
        if (count == (cnt1 + (cnt2 > 0))) {
          temp++;
          count = 0;
          cnt2--;
          temp = min(k - 1, temp);
        }
        j++;
      }
    } else {
      long long j = c;
      while (j >= 1) {
        if (arr[i][j] == 'R') count++;
        ans[i][j] = temp;
        if (count == (cnt1 + (cnt2 > 0))) {
          temp++;
          count = 0;
          cnt2--;
          temp = min(k - 1, temp);
        }
        j--;
      }
    }
  }
  for (long long i = 1; i <= r; i++) {
    for (long long j = 1; j <= c; j++) {
      if (ans[i][j] <= 25)
        cout << char('a' + ans[i][j]);
      else if (ans[i][j] <= 51)
        cout << char('A' + ans[i][j] - 26);
      else
        cout << char('0' + ans[i][j] - 52);
    }
    cout << endl;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
  return (0);
}
