#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
string name;
int dist[65];
int main() {
  for (int i = 0; i < 10; i++) {
    name += char('0' + i);
  }
  for (char i = 'a'; i <= 'z'; i++) {
    name += i;
  }
  for (char i = 'A'; i <= 'Z'; i++) {
    name += i;
  }
  int tc;
  cin >> tc;
  while (tc--) {
    int r, c, k;
    cin >> r >> c >> k;
    int rice = 0;
    string g[r];
    for (int i = 0; i < r; i++) {
      cin >> g[i];
      for (auto c : g[i]) {
        if (c == 'R') rice++;
      }
    }
    int d = rice / k;
    int m = rice % k;
    for (int i = 0; i < k; i++) {
      dist[i] = d;
      if (i < m) dist[i]++;
    }
    vector<pii> seq;
    for (int i = 0; i < r; i++) {
      vector<pii> tmp;
      for (int j = 0; j < c; j++) {
        tmp.push_back(pii(i, j));
      }
      if (i % 2 == 1) reverse(tmp.begin(), tmp.end());
      for (auto x : tmp) seq.push_back(x);
    }
    int curr = 0;
    for (auto it = seq.begin(); it != seq.end(); it++) {
      auto x = *it;
      int i = x.first, j = x.second;
      if (g[i][j] == 'R') {
        if (dist[curr] <= 0) {
          curr++;
          it--;
          continue;
        } else {
          dist[curr]--;
          g[i][j] = name[curr];
        }
      } else {
        g[i][j] = name[curr];
      }
    }
    for (int i = 0; i < r; i++) {
      cout << g[i] << endl;
    }
  }
}
