#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const string ans =
    "QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890";
int main() {
  int t;
  cin >> t;
  while (t--) {
    int r, c, k;
    cin >> r >> c >> k;
    vector<vector<int>> first(r, vector<int>(c));
    int tot = 0;
    for (int i = 0; i < r; i++) {
      string second;
      cin >> second;
      for (int j = 0; j < c; j++) {
        if (second[j] == 'R') {
          first[i][j] = -1;
          tot++;
        }
      }
    }
    int cnt = tot / k;
    int rem = tot - cnt * k;
    int curCmp = 1;
    int curCnt = 0;
    for (int i = 0; i < r; i++) {
      for (int j = 0; j < c; j++) {
        int cur = i % 2 == 0 ? j : c - 1 - j;
        if (first[i][cur] == -1) curCnt++;
        first[i][cur] = curCmp;
        if (curCmp <= rem && curCnt == cnt + 1 ||
            curCmp > rem && curCnt == cnt) {
          if (curCmp < k) curCmp++;
          curCnt = 0;
        }
      }
    }
    for (auto i : first) {
      for (int j : i) cout << ans[j - 1];
      cout << '\n';
    }
  }
  return 0;
}
