#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INTMAX = numeric_limits<int>::max();
void writeln() { cout << "\n"; }
template <class T>
inline void print(T&& a);
template <class T>
inline void priws(T&& a);
template <class T>
inline void read(T& a);
template <class... Args>
inline void readln(Args&... args) {
  (read(args), ...);
}
template <class H, class... T>
inline void writeln(H&& h, T&&... t) {
  priws(h);
  (print(t), ...);
  writeln();
}
vector<string> split(string& s, string d) {
  vector<string> v;
  size_t p = 0;
  while ((p = s.find(d)) != string::npos)
    v.push_back(s.substr(0, p)), s.erase(0, p + d.length());
  v.push_back(s);
  return v;
}
template <class... Args>
inline void err(string v, Args... args) {
  auto vv = split(v, ", ");
  auto it = vv.begin();
  (writeln(*it++, "=", args), ...);
}
void run() {
  int r, c, k;
  readln(r, c, k);
  vector<string> s(r), ans(r, string(c, 'q'));
  readln(s);
  string e = "qwretyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890";
  int cnt = 0;
  for (int i = 0; i < (int)(r); ++i)
    for (int j = 0; j < (int)(c); ++j) cnt += s[i][j] == 'R';
  cnt = max(cnt, k - 1);
  int full = cnt / k;
  int mod = cnt % k;
  int cur = 0;
  int index = 0;
  auto n = [&](int i, int j) {
    ans[i][j] = e[index];
    if (s[i][j] == 'R' || (full == 0 && mod)) {
      cur++;
      if (cur == full + (!!mod))
        index = min(k - 1, index + 1), cur = 0, mod = max(mod - 1, 0);
    }
  };
  for (int i = 0; i < (int)(r); ++i)
    if (i % 2 == 0)
      for (int j = 0; j < (int)(c); ++j) n(i, j);
    else
      for (int j = c - 1; j >= (int)(0); --j) n(i, j);
  writeln(ans);
}
int main() {
  ios_base::sync_with_stdio(false);
  int t;
  readln(t);
  for (int i = 0; i < (int)(t); ++i) run();
  cerr << fixed << setprecision(0)
       << "Execution time = " << 1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";
  return 0;
}
template <class T1, class T2>
inline ostream& operator<<(ostream& os, pair<T1, T2> const& _a);
template <
    typename T, typename D = decltype(*begin(declval<T>())),
    typename enable_if<!is_same<T, basic_string<char>>::value>::type* = nullptr>
ostream& operator<<(ostream& os, T const& _a) {
  auto it = begin(_a);
  if (it != end(_a)) os << *it++;
  while (it != end(_a))
    os << "\n "[is_fundamental<typename T::value_type>::value] << *it++;
  return os;
}
template <class T1, class T2>
inline ostream& operator<<(ostream& os, pair<T1, T2> const& _a) {
  return os << _a.first << " " << _a.second;
}
template <class T1, class T2>
inline istream& operator>>(istream& is, pair<T1, T2>& _a) {
  return is >> _a.first >> _a.second;
}
template <class T>
inline istream& operator>>(istream& is, vector<T>& _a) {
  for (int i = 0; i < (int)(_a.size()); ++i) is >> _a[i];
  return is;
}
template <class T>
inline void print(T&& _a) {
  cout << " " << _a;
}
template <class T>
inline void priws(T&& _a) {
  cout << _a;
}
template <class T>
inline void read(T& _a) {
  cin >> _a;
}
