#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T = 1;
  cin >> T;
  while (T--) {
    int n, m, k;
    cin >> n >> m >> k;
    vector<string> v(n);
    int cnt = 0;
    for (int i = 0; i < n; i++) cin >> v[i];
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++)
        if (v[i][j] == 'R') cnt++;
    int val = cnt / k, mn = k - cnt % k;
    int chicken = 0;
    char ans[n][m];
    char c = 'a';
    int rice = 0;
    for (int i = 0; i < n; i++) {
      if (i % 2) {
        for (int j = m - 1; j >= 0; j--) {
          ans[i][j] = c;
          if (v[i][j] == 'R') {
            rice++;
            if (rice == val) {
              chicken++;
              if (chicken < k) {
                if (c == 'z')
                  c = 'A';
                else if (c == 'Z')
                  c = '0';
                else
                  c++;
                rice = 0;
                if (chicken == mn) val++;
              }
            }
          }
        }
      } else {
        for (int j = 0; j < m; j++) {
          ans[i][j] = c;
          if (v[i][j] == 'R') {
            rice++;
            if (rice == val) {
              chicken++;
              if (chicken < k) {
                if (c == 'z')
                  c = 'A';
                else if (c == 'Z')
                  c = '0';
                else
                  c++;
                rice = 0;
                if (chicken == mn) val++;
              }
            }
          }
        }
      }
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        cout << ans[i][j];
      }
      cout << "\n";
    }
  }
}
