#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, row, col, k;
  string abc = "QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890";
  cin >> t;
  while (t--) {
    cin >> row >> col >> k;
    string s[row];
    int n = 0;
    for (int i = 0; i < row; i++) {
      cin >> s[i];
      n += count(s[i].begin(), s[i].end(), 'R');
    }
    int a = n / k, b = n % k;
    int r = 0, c = 0, dif = 1, j = 0;
    for (int i = 0; i < k; i++) {
      if (i == k - b) a++;
      int m = 0;
      while (m < a) {
        if (s[r][c] == 'R') m++;
        s[r][c] = abc[j];
        c += dif;
        if (c == col) {
          cout << s[r] << endl;
          r++;
          c--;
          dif = -1;
        }
        if (c == -1) {
          cout << s[r] << endl;
          r++;
          c++;
          dif = 1;
        }
      }
      j++;
    }
    j--;
    while (r < row) {
      s[r][c] = abc[j];
      c += dif;
      if (c == col) {
        cout << s[r] << endl;
        r++;
        c--;
        dif = -1;
      }
      if (c == -1) {
        cout << s[r] << endl;
        r++;
        c++;
        dif = 1;
      }
    }
  }
}
