#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " , ";
  __f(comma + 1, args...);
}
int main() {
  ios::sync_with_stdio(0);
  int i, j, k, n, t;
  string c = "0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
  cin >> t;
  while (t--) {
    int m;
    cin >> n >> m >> k;
    vector<vector<int>> a(n, vector<int>(m));
    int tot = 0;
    for (i = 0; i < n; ++i) {
      string s;
      cin >> s;
      for (j = 0; j < m; ++j) {
        a[i][j] = (s[j] == 'R');
        tot += a[i][j];
      }
    }
    int all = tot / k;
    int extra = tot % k;
    int curr = 0;
    int temp = 0;
    vector<vector<int>> ans(n, vector<int>(m));
    for (i = 0; i < n; ++i) {
      if (!(i & 1)) {
        for (j = 0; j < m; ++j) {
          ans[i][j] = curr;
          if (a[i][j]) {
            temp++;
            if (temp == all + (extra > 0)) {
              curr++;
              if (curr == k) curr--;
              temp = 0;
              extra--;
            }
          }
        }
      } else {
        for (j = m - 1; j >= 0; --j) {
          ans[i][j] = curr;
          if (a[i][j]) {
            temp++;
            if (temp == all + (extra > 0)) {
              curr++;
              if (curr == k) curr--;
              temp = 0;
              extra--;
            }
          }
        }
      }
    }
    for (i = 0; i < n; ++i) {
      for (j = 0; j < m; ++j) cout << c[ans[i][j]];
      cout << "\n";
    }
  }
  return 0;
}
