#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string get = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
  int t, r, c, rcount, i, j, k;
  cin >> t;
  while (t--) {
    cin >> r >> c >> k;
    rcount = 0;
    char grid[r][c];
    for (int i = 0; i < r; i++) {
      for (int j = 0; j < c; j++) {
        cin >> grid[i][j];
        if (grid[i][j] == 'R') rcount++;
      }
    }
    int avg = rcount / k;
    int dif = rcount % k;
    int curcount = 0;
    k--;
    for (i = 0; i < r; i++) {
      for (j = ((i & 1) ? c - 1 : 0); (i & 1) ? j >= 0 : j <= c - 1;
           (i & 1) ? j-- : j++) {
        if (grid[i][j] == 'R') {
          curcount++;
        }
        grid[i][j] = get[k];
        if (dif) {
          if (curcount == avg + 1) {
            dif--;
            curcount = 0;
            k--;
          }
        } else {
          if (curcount == avg) {
            curcount = 0;
            k--;
          }
        }
        if (k == -1) goto label;
      }
    }
  label:;
    for (int i = 0; i < r; i++) {
      for (int j = 0; j < c; j++) {
        if (grid[i][j] == '.') grid[i][j] = get[0];
        cout << grid[i][j];
      }
      cout << '\n';
    }
  }
  return 0;
}
