#include <bits/stdc++.h>
using namespace std;
double PI = acos(-1.0);
long long mod = 1e9 + 7;
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
long long GCD(long long a, long long b) {
  if (b == 0) return a;
  return GCD(b, a % b);
}
long long prod(long long a, long long b) {
  long long res = 0;
  a %= mod;
  while (b) {
    if (b & 1ll) res = (res + a) % mod;
    a = (2ll * a) % mod;
    b >>= 1ll;
  }
  return res;
}
long long power(long long a, long long b) {
  long long res = 1ll;
  while (b > 0) {
    if (b % 2ll) res = (res * a) % mod;
    a = (a * a) % mod;
    b /= 2ll;
  }
  return res;
}
void solve() {
  long long r, c, k;
  cin >> r >> c >> k;
  vector<string> a(r), ans(r, string(c, '.'));
  long long x = 0;
  for (long long i = 0; i < r; i++) {
    char t;
    for (long long j = 0; j < c; j++) {
      cin >> t;
      a[i].push_back(t);
      if (t == 'R') {
        x++;
      }
    }
  }
  long long aa = k - (x % k), b = x % k;
  long long i = 0, j = 0;
  char ch = '0';
  bool right = true;
  for (long long f = 0; f < b; f++) {
    long long cnt = 0;
    while (cnt < (x / k + 1)) {
      if (j == c) {
        j = c - 1;
        right = false;
        i++;
      } else if (j == -1) {
        right = true;
        j = 0;
        i++;
      }
      ans[i][j] = ch;
      if (a[i][j] == 'R') {
        cnt++;
      }
      if (right)
        j++;
      else
        j--;
    }
    if (ch == '9') {
      ch = 'a';
    } else if (ch == 'z') {
      ch = 'A';
    } else {
      ch++;
    }
  }
  for (long long f = 0; f < aa; f++) {
    long long cnt = 0;
    while (cnt < (x / k)) {
      if (j == c) {
        j = c - 1;
        right = false;
        i++;
      } else if (j == -1) {
        right = true;
        j = 0;
        i++;
      }
      ans[i][j] = ch;
      if (a[i][j] == 'R') {
        cnt++;
      }
      if (right)
        j++;
      else
        j--;
    }
    if (f == aa - 1) break;
    if (ch == '9') {
      ch = 'a';
    } else if (ch == 'z') {
      ch = 'A';
    } else {
      ch++;
    }
  }
  while (i < r) {
    if (j == c) {
      j = c - 1;
      right = false;
      i++;
    } else if (j == -1) {
      right = true;
      j = 0;
      i++;
    }
    if (i >= r) break;
    ans[i][j] = ch;
    if (right)
      j++;
    else
      j--;
  }
  for (i = 0; i < r; i++) {
    cout << ans[i] << "\n";
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
