#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
const long INF = 1000 * 1000 * 1000;
const long long int mod = 1000000007;
char a[200][200], an[200][200];
vector<char> v;
int r, c;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  for (int i = 0; i < 26; i++) {
    v.push_back('A' + i);
    v.push_back('a' + i);
  }
  for (int i = 0; i < 10; i++) {
    v.push_back('0' + i);
  }
  while (t--) {
    int k, x, y, count = 0, p = 1, q = 0, count2 = 0;
    cin >> r >> c >> k;
    for (int i = 0; i < r; i++) {
      for (int j = 0; j < c; j++) {
        cin >> a[i][j];
        if (a[i][j] == 'R') {
          count++;
        }
      }
    }
    x = count / k;
    for (int i = 0; i < r; i++) {
      if (i % 2 == 0) {
        for (int j = 0; j < c; j++) {
          if (a[i][j] == 'R') {
            q++;
          }
          an[i][j] = v[p - 1];
          if (q == x && k != 1) {
            q = 0;
            count2++;
            p++;
            k--;
            if ((count - count2 * x) == (x + 1) * k) {
              x++;
            }
          }
        }
      } else {
        for (int j = c - 1; j >= 0; j--) {
          if (a[i][j] == 'R') {
            q++;
          }
          an[i][j] = v[p - 1];
          if (q == x && k != 1) {
            q = 0;
            count2++;
            p++;
            k--;
            if ((count - count2 * x) == (x + 1) * k) {
              x++;
            }
          }
        }
      }
    }
    for (int i = 0; i < r; i++) {
      for (int j = 0; j < c; j++) {
        cout << an[i][j];
      }
      cout << '\n';
    }
  }
}
