#include <bits/stdc++.h>
using namespace std;
int T, n, m, k;
string ans[20010];
string s[20010];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string S = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
  cin >> T;
  while (T--) {
    cin >> n >> m >> k;
    int r = 0;
    for (int i = 0; i < n; i++) {
      cin >> s[i];
      for (int j = 0; j < m; j++)
        if (s[i][j] == 'R') r++;
    }
    int total = r / k;
    int remain = r % k;
    int tmp = 0, cnt = 0, flip = 0;
    for (int i = 0; i < n; i++) {
      ans[i] = "";
      if (flip == 0) {
        for (int j = 0; j < m; j++) {
          if (s[i][j] == 'R') tmp++;
          ans[i] = ans[i] + S[cnt];
          if (remain > 0 && tmp == total + 1 && k > 0) {
            tmp = 0;
            remain--;
            k--;
            if (k != 0) cnt++;
          } else if (remain == 0 && tmp == total && k > 0) {
            tmp = 0;
            k--;
            if (k != 0) cnt++;
          }
        }
        flip = 1;
      } else {
        for (int j = m - 1; j >= 0; j--) {
          if (s[i][j] == 'R') tmp++;
          ans[i] = S[cnt] + ans[i];
          if (remain > 0 && tmp == total + 1 && k > 0) {
            tmp = 0;
            remain--;
            k--;
            if (k != 0) cnt++;
          } else if (remain == 0 && tmp == total && k > 0) {
            tmp = 0;
            k--;
            if (k != 0) cnt++;
          }
        }
        flip = 0;
      }
    }
    for (int i = 0; i < n; i++) cout << ans[i] << "\n";
  }
}
