#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e2 + 5;
char mp[MAXN][MAXN];
char ans[MAXN][MAXN];
char co[70];
int p;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  for (int i = 0; i < 26; ++i) co[i] = 'a' + i;
  for (int i = 26; i < 52; ++i) co[i] = 'A' + i - 26;
  for (int i = 52; i < 62; ++i) co[i] = '0' + i - 52;
  int t;
  cin >> t;
  while (t--) {
    memset(ans, 0, sizeof(ans));
    p = 0;
    int r, c, k;
    cin >> r >> c >> k;
    for (int i = (1); i <= ((r)); ++i) cin >> mp[i] + 1;
    int tot = 0;
    for (int i = (1); i <= ((r)); ++i)
      for (int j = (1); j <= ((c)); ++j)
        if (mp[i][j] == 'R') ++tot;
    int x = tot / k, y = tot % k, cnty = 0;
    int a = 1, b = 0, cur = 0;
    int d = 1;
    bool notadd = 1;
    while (cnty < k) {
      bool flag = 1;
      if (d == 1) {
        while (b + 1 <= c) {
          ++b;
          ans[a][b] = co[p];
          if (mp[a][b] == 'R') ++cur;
          if (cur == x) {
            ++p;
            cur = 0;
            ++cnty;
            flag = 0;
            break;
          }
        }
        if (cnty == k) break;
        if (cnty == k - y && notadd) {
          notadd = 0;
          ++x;
        }
        if (flag) {
          ++a;
          ++b;
          d = -d;
        }
      } else {
        while (b - 1 >= 1) {
          --b;
          ans[a][b] = co[p];
          if (mp[a][b] == 'R') ++cur;
          if (cur == x) {
            flag = 0;
            ++p;
            cur = 0;
            ++cnty;
            break;
          }
        }
        if (cnty == k) break;
        if (cnty == k - y && notadd) {
          notadd = 0;
          ++x;
        }
        if (flag) {
          ++a;
          --b;
          d = -d;
        }
      }
    }
    --p;
    for (int i = (1); i <= ((r)); ++i)
      for (int j = (1); j <= ((c)); ++j)
        if (!ans[i][j]) ans[i][j] = co[p];
    for (int i = (1); i <= ((r)); ++i) cout << ans[i] + 1 << endl;
  }
}
