#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e2 + 10;
char s[105][105];
char a[105][105];
string mp = "aabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
int main() {
  int T, n, m, k;
  cin >> T;
  while (T--) {
    cin >> n >> m >> k;
    int r = 0;
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) {
        cin >> s[i][j];
        if (s[i][j] == 'R') r++;
      }
    }
    int cnt = 1, p = 0;
    int t = r / k, y = r % k, x = k - y;
    for (int i = 1; i <= n; i++) {
      if (i % 2 == 1) {
        for (int j = 1; j <= m; j++) {
          if (s[i][j] == '.' || cnt == k) {
            a[i][j] = mp[cnt];
            continue;
          }
          ++p;
          if (cnt <= x) {
            a[i][j] = mp[cnt];
            if (p == t) p = 0, ++cnt;
          } else if (cnt > x) {
            a[i][j] = mp[cnt];
            if (p == t + 1) p = 0, ++cnt;
          }
        }
      } else {
        for (int j = m; j >= 1; j--) {
          if (s[i][j] == '.' || cnt == k) {
            a[i][j] = mp[cnt];
            continue;
          }
          ++p;
          if (cnt <= x) {
            a[i][j] = mp[cnt];
            if (p == t) p = 0, ++cnt;
          } else if (cnt > x) {
            a[i][j] = mp[cnt];
            if (p == t + 1) p = 0, ++cnt;
          }
        }
      }
    }
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) {
        printf("%c", a[i][j]);
      }
      printf("\n");
    }
  }
  return 0;
}
